⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getpass.asp

📁 本程序蓝本为6kbbs 默认前台管理员的帐号是:woodcoal
💻 ASP
字号:
<!--#include file="up.asp"--><!--#include file="inc/md5.asp"-->
<%
dim t1,t2,d1,d2,getpwd,name,question,sr,answer,newpwd,repwd,canedit,passc,sickpass
t1=""
t2="</b></font></p></td></tr></table><table align=center border=1 cellpadding=0 cellspacing=0 style='border-collapse: collapse' bordercolor="&c1&" width=98% >"
d1="<tr><td width=100% >"
d2="</td></tr></table>"
menu=request.querystring("menu")
select case menu
case""
%><form method=POST name=kbbs action=?menu=postname>
<%=ttop%>
<table bordercolor="<%=c1%>" align="center" border="1" bgcolor="<%=c2%>"cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="<%=tbw%>">
<tr>
    <td class=td1 width="100%" bgcolor="<%=c1%>" background="<%=tbg%>" height="28">&nbsp; <img src="pic/gl.gif" border="0"><font color="<%=c3%>"> 找回密码</font></td>
  </tr>
  <tr>
    <td width="100%">
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bgcolor="<%=c2%>">
  
        <tr>
  <td width="82%" colspan="2">
         </td>
      </tr>
        <tr>
        <td width="40%">
        <p style="line-height: 120%; margin: 4"><b>请输入你的用户名:</b><br>
        </td>
        <td width="42%"> <input type="text" name="name" size="20">  <input class=submit type=submit value="提交 " name=Submit></td>
      </tr>
      <tr>
  <td width="82%" colspan="2">
         </td>
      </tr>

      </table></table><%=tbottom%><br><br><br><br><br><br>
</form>
<%case"postname"
getpwd=true
name=Replace(Request.Form("name"),"'","")
set rs=conn.execute("select question from [user] where name='"&name&"'")
if rs.eof then
mes="该用户不存在"
getpwd=false
else
question=rs("question")
set sr=conn.execute("select name from [admin] where name='"&name&"'")
if not sr.eof then
tl=""
mes="该用户是管理员或版主,忘记密码请与管理员联系!"
getpwd=false
end if
set sr=nothing
end if
set rs=nothing
if getpwd=false then
%><script language=vbscript>
     MsgBox "<%=mes%>"
     location.href = "getpass.asp"
 </script>
<%else%>
<form method="POST" action="?menu=get"><%=ttop%>
<table bordercolor="<%=c1%>" align="center" border="1" bgcolor="<%=c2%>"cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="<%=tbw%>">
<tr>
    <td class=td1 width="46%" bgcolor="<%=c1%>" background="<%=tbg%>" height="28" colspan="2">&nbsp; <img src="pic/gl.gif" border="0"><font color="<%=c3%>"> 
	<b>找回密码</b></font></td>
  </tr>
  <tr><input type="hidden" name="name" size="20" value="<%=name%>">
              </tr>
       <tr>        <td width="46%" height="33">
        <p style="line-height: 120%; margin: 4" height="35"><b>提示问题:</b><br>
        </td>
        <td width="53%" height="33"> <%=kbbs(question)%></td>
      </tr>
       

       <tr>        <td width="46%" height="30">
        <p style="line-height: 120%; margin: 4" height="35"><b>问题回答:</b><br>
        </td>
        <td width="53%" height="30"> <input type="text" name="answer" size="20"></td>
      </tr>
      <tr>        <td width="99%" height="35" colspan="2" height="35">
		<p align="center"><input type="submit" value=" 提   交 " name="B1"> <input type="reset" value=" 重   置 " name="B2">
         </td>
      </tr>
</table><%=tbottom%><br></form>
<%end if%>
<%case"get"
name=Replace(Request.Form("name"),"'","")
answer=Replace(Request.Form("answer"),"'","")
set rs=conn.execute("select name from [user] where name='"&name&"' and answer='"&answer&"'")
if rs.eof then
%><script language=vbscript>
     MsgBox "注意:您填写的问题答案不正确.如有想不起来可以联系管理员."
     location.href = "getpass.asp?menu=postname"
 </script>
<%else
%><form method="POST" action="?menu=change"><%=ttop%>
<table bordercolor="<%=c1%>" align="center" border="1" bgcolor="<%=c2%>"cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="<%=tbw%>">
<tr>
    <td class=td1 width="46%" bgcolor="<%=c1%>" background="<%=tbg%>" height="28" colspan="2">&nbsp; <img src="pic/gl.gif" border="0"><font color="<%=c3%>"> 
	</font><b>更新密码</b></td>
  </tr>
  <tr><input type="hidden" name="name" size="20" value="<%=name%>">
              </tr>
       <tr>        <td width="46%" height="37">
        <p style="line-height: 120%; margin: 4"><b>新 密 码:</b><br>
        </td>
        <td width="53%" height="37"> <input type="password" name="newpwd" size="20">
</td>
      </tr>

      <tr>        <td width="46%" height="35">
        <p style="line-height: 120%; margin: 4"><b>重复密码:</b><br>
        </td>
        <td width="53%" height="35"> <input type="password" name="repwd" size="20">
</td>
      </tr>
<tr>        <td width="99%" colspan="2" height=35>
	<p align="center"><input type="submit" value=" 提   交 " name="B1"> <input type="reset" value=" 重   置 " name="B2">
         </td></tr></table><%=tbottom%><br></form><%end if
set rs=nothing%><%case"change"
name=Replace(Request.Form("name"),"'","")
newpwd=Replace(Request.Form("newpwd"),"'","''")
repwd=Replace(Request.Form("repwd"),"'","''")
canedit=true

if newpwd="" or repwd="" then
canedit=false
mes="·请填写完整必填的资料。<br>"
else
mes=""

if len(newpwd)>16 then canedit=false : mes=mes&"·你填写的新密码长度超过了16。<br>"
sickpass=split("123$$1234$$12345$$123456$$1234567$$12345678$$aaa$$111","$$")
for i=0 to ubound(sickpass) 
if len(newpwd)<3 or newpwd=sickpass(i) then
canedit=false
mes=mes&"·你的新密码属于弱口令,请更换密码。<br>"
exit for
end if
next
if repwd<>newpwd then canedit=false : mes=mes&"·你两次输入的密码不一样。<br>"

end if

if canedit=false then
tl=""
mes="<b>对不起!你不能成功修改你的密码,可能存在以下问题。</b><br>"&mes&"·<a href='javascript:history.go(-1)'><img border=0 src=pic/re.gif align=absmiddle> 返回重新填写。</a>"
elseif canedit=true then
newpwd=md5(newpwd)
conn.execute("update [user] set [password]='"&newpwd&"' where name='"&name&"'")

Response.Cookies(prefix)("lgpwd")=newpwd
if lgcook>0 then
Response.Cookies(prefix).Expires=date+lgcook
end if

tl=1
mes="你的密码修改成功。"

end if
call sendinfo(tl,mes)
%><%
set rs=nothing%><%end select
call down%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -