www.gusucode.com > 盐城分类信息网asp源码程序 > admin/user_passchk.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,password,username,email username=trim(request("username")) if not isnumeric(username) or username="" then response.write "<li>参数错误1!" 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 [user] where username='"&username&"'" rs.open sql,conn,1,3 if rs.eof or rs.bof then response.write "<li>参数错误2!" call cl() response.end end if username=trim(rs("username")) email=trim(rs("email")) rs("password")=md5(password) rs.update rs.close set rs=nothing closedb response.write "<li>修改密码成功,并且给用户发了一封邮件,以便及时通知用户!" call cl() call mail() %> <% sub mail() dim mailbody,Jmail mailbody="["&name&"],因系统问题管理员已为你成功修改了密码!现在资料为:登陆帐号:["&username&"] 你的新密码是:["&password&"] 如果更改密码可以到 <a href="&web&">"&web&"</a> 谢谢你使用我们<a href="&web&">"&title&"的服务!" '邮件内容 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%>