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

📄 getpass.asp

📁 购物系统时尚版.强大的后台文章编辑器的功能
💻 ASP
字号:
<%
dim key,toppath,dbpath
toppath=""
dbpath=""
%>
<!--#include file="db_conn.asp" -->
<!--#include file="my_lib/my_request.asp"-->
<!--#include file="my_lib/md5.asp"-->
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/main.css" rel="stylesheet" type="text/css">
<SCRIPT language="javascript">
<!--
function chkinput()
{
 if (document.form1.email.value == "")        
  {        
    window.alert("请输入用户名!");        
    document.form1.email.focus();        
    return false;}
 if (document.form1.answer.value == "")        
  {        
    window.alert("请输入问题的答案!");        
    document.form1.answer.focus();        
    return false;}
 if(document.form1.password2.value!==document.form1.password.value)	
  {
	  window.alert("两次密码输入不一致。")
	  return false;}
 }
  //--></SCRIPT>
<title>忘记密码</title>
</head>

<body topmargin="1">
<!--#include file="top.asp"-->

<div align="center">

	<table border="0" width="760" id="table1" cellpadding="0" bordercolor="#F47E36" cellspacing="0">
		<tr>
			<td>
			<div align="center">
				<table border="0" width="62%" id="table2" bgcolor="#F9F9F9">
<%
action=my_request("action",0)
select case action
case ""
call getuser()
case "setp1"
call getquestion()
case "setp2"
call dpassok()
case "setp3"
call isok()
case else
call getuser()
end select
%></table>
			</div>
			</td>
		</tr>
	</table>
</div>
<!--#include file="end.asp" -->
</body>

</html>
<%sub getuser()%>
<form action="getpass.asp" method="post" name=form1 onsubmit="return chkinput();">
<tr>
<td colspan="2" height="20">
<p align="center">忘记密码(找回密码)</td>
</tr>
<tr>
<td width="38%" align="right" height="20">
用请输入注册时用户名:</td>
<td width="60%" height="20">
<input type="text" name="email" size="20" maxlength="20">
<input name=action type=hidden id=action value=setp1></td>
</tr>
<tr>
<td width="98%" align="right" colspan="2" height="20">
<p align="center">
<input type="submit" value="下一步" name="B1">
<input type="reset" value="重置" name="B2"> </td>
</tr></form>
<%end sub%>

<%
sub getquestion()
email=my_request("email",0)
if email="" then
response.write"<SCRIPT language=JavaScript>alert('请输入用户名!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from user_info_list where txt_login_name='"&email&"'"
rs.open sql,conn,1,3
if not (rs.bof and rs.eof) then
question=rs("txt_question")
rs.close
set rs=nothing
%>
<form action="getpass.asp" method="post" name=form1 onsubmit="return chkinput();">
<tr>
<td colspan="2" height="20">
<p align="center">忘记密码(找回密码)</td>
</tr>
<tr>
<td width="38%" align="right" height="20">
您的问题:</td>
<td width="60%" height="20">
<%=question%></td>
</tr>
<tr>
<td width="38%" align="right" height="20">
请填写问题的答案:</td>
<td width="60%" height="20">
<input type="text" name="answer" size="20" maxlength="20">
<input name=action type=hidden id=action value=setp2>
<input name=email type=hidden id=email value="<%=email%>">
<input name=question type=hidden id=question value="<%=question%>">
</td>
</tr>
<tr>
<td width="98%" align="right" colspan="2" height="20">
<p align="center">
<input type="submit" value="下一步" name="B1">
<input type="reset" value="重置" name="B2"> </td>
</tr></form>
<%
else
response.write "<br>&nbsp;<span>·<a href=""#"" onclick=history.back()>此用户不存在!</a></span>"
end if
rs.close
set rs=nothing
end sub
%>
<%
sub dpassok()
email=my_request("email",0)
question=my_request("question",0)
answer=my_request("answer",0)
set rs=server.createobject("adodb.recordset")
sql="select * from user_info_list where txt_login_name='"&email&"' and txt_answer='"&md5(answer,32)&"' and txt_question='"&question&"'"
rs.open sql,conn,1,3
if not (rs.eof and rs.bof) then
%>
<form action="getpass.asp" method="post" name=form1 onsubmit="return chkinput();">
<tr>
<td colspan="2" height="20">
<p align="center">忘记密码(找回密码)</td>
</tr>
<tr>
<td width="38%" align="right" height="20">
请输入新密码:</td>
<td width="60%" height="20">
<input type=password name=password size=25 maxlength=15>(5~15位)</td>
</tr>
<tr>
<td width="38%" align="right" height="20">
请确认新密码:</td>
<td width="60%" height="20">
<input type=password name=password2 size=25 maxlength=15>(5~15位)
<input name=action type=hidden id=action value=setp3><input name=email type=hidden id=email value="<%=email%>"></td>
</tr>
<tr>
<td width="98%" align="right" colspan="2" height="20">
<p align="center">
<input type="submit" value="下一步" name="B1">
<input type="reset" value="重置" name="B2"> </td>
</tr></form>
<%
else
response.write "<span>·<a href=""#"" onclick=history.back()>您输入的答案有误!</a></span>"
end if
rs.close
set rs=nothing
end sub
%>
<%
sub isok()
password=my_request("password",0)
password2=my_request("password2",0)
email=my_request("email",0)
if password="" or password2="" then
response.write"<SCRIPT language=JavaScript>alert('请填写密码!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
if password<>password2 then
response.write"<SCRIPT language=JavaScript>alert('两次密码输入不一致!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
password=md5(password,32)
sql="update user_info_list set txt_login_pass='"&password&"' where txt_login_name='"&email&"'"
conn.execute (sql)
Response.write "<script>alert(""密码修改成功,请用新的密码登录!"");location.href=""login.asp"";</script>"
Response.end
end sub
%>

⌨️ 快捷键说明

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