当前位置:编程学习 > asp >>

asp用户找回密码功能

表:user 用户名:username 通过注册时候的用户名来找回密码,用户名都是邮箱地址填写的。所以输入用户名点下一步就把新密码或者旧密码发到他的邮箱里。。你有好的代码也可以发上来,这是现在页面上的程序代码,不过出了错了。看的懂也可以在这原代码上修改。完成的话,我会加分的哦。。要原代码可以加我QQ:382400107<%response.contenttype="text/html;charset=gb2312"Response.expires=-1 Response.AddHeader"pragma","no-cache" Response.AddHeader"cache-control","no-store" dim rs,username,pq,pa,str,JMailif request("ac")="send" thenusername=Srequest("Username",0)pa=Srequest("Username",0)set rs=server.CreateObject("adodb.recordset")rs.open "select username,paw from [user] where username='"&username&"'",conn,1,3if rs.eof and rs.bof thenresponse.Write("")response.End()elsestr=GetRnd(6)rs("paw")=md5(str,16)rs.updaters.closeset rs=nothingstr=username&"您好!您的新密码为"&str&",请尽快登录网站修改您的密码!" Set JMail=Server.CreateObject("JMail.message") JMail.ContentType="text/html" JMail.Encoding = "base64" JMail.Charset="gb2312" JMail.MailServerUserName = "support@howju.com" ' 身份验证的用户名 JMail.MailServerPassword = "123456" ' 身份验证的密码 JMail.from = "support@howju.com" JMail.Subject = "好居网( www.howju.com)客服中心发给您的密码!" JMail.AddRecipient(pa) JMail.Body =str JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR") JMail.send ("mail.howju.com") JMail.Close Set JMail = Nothing response.Write("")end ifend if%>
答案:因代码较多,这里输入不下,你从这个地址打开,这个肯定可以用,你只要修改数据库连接,读取的用户表就可以,若还有问题,你加我吧,我帮你搞定它. http://www.wypz.com/email.txt我的站  http://www.wypz.com/DaTouTie/getpass.asp 这里就在用
要求用户回答密码找回的所有问题 然后跳转到动态页面利用脚本语言和数据库交互做个查询功能如果此用户填写的密码找回问题全部正确 系统将用户的密码改成一个随机密码。然后把这个密码用email发给用户
答案补充
dim num,copyRandomizenum = Int(Rnd*(9999-1000+1)) + 1000copy = num这样取伪随机数 然后把COPY在数据库中换成用户的新密码 发给用户

上一个:ASP判断表是否存在
下一个:asp问题,关于sql

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,