www.gusucode.com > 盐城分类信息网asp源码程序 > admin/com_editpasschk.asp
<!--#include file=conn.asp--> <!--#include file=cookies.asp--> <!--#include file=../config.asp--> <!--#include file=../mail.asp--> <!--#include file=../md5.asp--> <link href="inc_style.css" rel="stylesheet" type="text/css"> <% dim rs,sql,id,password,username,email id=trim(request("id")) if not isnumeric(id) or id="" then response.write "<li>参数错误!" response.end end if password=trim(request("password")) if password="" or len(password)<3 or len(password)>15 then response.write "<li>密码必须在3-15位之间!" call cl() response.end end if set rs=server.createobject("adodb.recordset") sql="select username,password,email from [com] where id="&id rs.open sql,conn,1,3 if rs.eof or rs.bof then response.write "<li>参数错误!" call cl() response.end end if username=trim(rs("username")) email=trim(rs("email")) rs("password")=password rs.update rs.close set rs=nothing closedb response.write "<li>修改密码成功,并且给用户发了一封邮件,以便及时通知用户!" call cl() call mail() %> <% sub mail() dim mailbody,Jmail mailbody="欢迎您,"&username&"!<br>管理员已为你成功修改了密码!现在资料为:登陆帐号:["&username&"] 你的新密码是:["&password&"]<br> 如果您要发布您的相关信息可以到 <a href="&web&">"&web&"</a> 进行发布!我们的失误,给您带来的不便,请见谅!<br>谢谢您使用我们<a href="&web&">"&title&"</a>为您提供的真诚服务!" '邮件内容 Set Jmail=server.createobject("Jmail.Message") Jmail.Charset ="gb2312" JMail.ContentType = "text/html" Jmail.Silent =true Jmail.Priority = 3 Jmail.MailServerUserName = mailname Jmail.MailServerPassword = mailpass Jmail.From = mailform Jmail.FromName =""&title&"" Jmail.Subject ="密码修改成功!-" Jmail.AddRecipient ""&email&"" Jmail.Body = mailbody Jmail.Send(mailsmtp) Set Jmail=nothing end sub %> <%sub cl()%> <body onLoad="setTimeout(window.close, 2000)"> <%end sub%>