www.gusucode.com > 运动用品商城网站系统源代码程序 > repass.asp

    <!--#include file="conn.asp"-->
<!--#include file="IncAsp/venshop_top.asp"-->
<!-- #include file="IncAsp/venshop_md5.asp" -->
<div align="center">
<table border="0" cellpadding="5" cellspacing="0" width="980" bgcolor="#FFFFFF" height="300"><tr>
	<td align="center">

<%user_name=DelStr(request("user_name"))
question=DelStr(request("question"))
answer=DelStr(request("answer"))
pass1=DelStr(md5(request("pass1")))
pass2=DelStr(md5(request("pass2")))
if request("action")="repass1" then%>

<table border="0" cellpadding="0" cellspacing="0" width="99%" style="border: 1px solid #C0C0C0">
<tr><td height="30" style="border-bottom: 1px solid #E1E1E1" colspan="3">&nbsp;<IMG src="Skin/<%=venshop_skin%>/home.gif" border=0 align="absmiddle"> 您的位置:  
	<a href="index.asp">首页</a> >>&nbsp;找回密码</td></tr>
<%
if user_name="" then
response.write "<tr><td colspan=3 align=center height=100>请输入用户名,<a href=# onClick=history.go(-1)><font color=#ff0000>返回</font></a> !</td></tr>"
else
set rs=server.createobject("adodb.recordset")
sql="select * from venshop_user where username='"&user_name&"'"
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td colspan=3 align=center height=100>没有这个用户名,<a href=# onClick=history.go(-1)><font color=#ff0000>返回</font></a> !</td></tr>"
else
if rs("question")="" or rs("answer")="" then
response.write "<tr><td colspan=3 align=center height=100>您没有填写密码保护资料,无法找回密码,请联系管理员,<a href=# onClick=history.go(-1)><font color=#ff0000>返回</font></a> !</td></tr>"
else
%>

<tr> 
    <td colspan="3" align="center" height="30">第二步:请输入密码保护问题答案</td>
 </tr>
   	<form method="POST" name="form" action="repass.asp?action=repass2"><tr> 
    <td align="right" height="30" width="200">用户名:</td>
    <td height="30" width="25"></td>
    <td height="30" width="400"><%=rs("username")%><input name="user_name" type="hidden" value="<%=rs("username")%>"></td>
   </tr>
   	<tr> 
    <td align="right" height="30" width="200">预设的密码保护问题:</td>
    <td height="30" width="25"></td>
    <td height="30" width="400"><%=rs("question")%><input name="question" type="hidden" value="<%=rs("question")%>"></td>
   </tr>
   	<tr>
    <td align="right" height="30" width="200">请输入密码保护答案:</td>
    <td height="30" width="25"></td>
    <td height="30" width="400"><input name="answer" type="text" class=input size="20"></td>
    </tr>
   	<tr><td align="center" colspan="3" height="30"><input type=submit value=下一步 name="submit1"></td></tr>
   </form>
<%end if
end if
rs.close
set rs=nothing
end if
%>
</table>

<%elseif request("action")="repass2" then%>

<table border="0" cellpadding="0" cellspacing="0" width="99%" style="border: 1px solid #C0C0C0">
<tr><td height="30" style="border-bottom: 1px solid #E1E1E1" colspan="3">&nbsp;<IMG src="Skin/<%=venshop_skin%>/home.gif" border=0 align="absmiddle"> 您的位置:  
	<a href="index.asp">首页</a> >>&nbsp;找回密码</td></tr>
<%set rs=server.createobject("adodb.recordset")
sql="select * from venshop_user where username='"&user_name&"' and question='"&question&"' and answer='"&answer&"'"
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td colspan=3 align=center height=100>密码找回答案错误,请确认,<a href=# onClick=history.go(-1)><font color=#ff0000>返回</font></a> !</td></tr>"
else%>
 <form method="POST" name="form2" action="repass.asp?action=repass3"><tr> 
    <td colspan="3" align="center" height="30">第三步:请重新设定密码</td></tr>
   	<tr><td width="200" align="right" height="30">用户名:</td>
    <td width="25" height="30"></td>
    <td width="400" height="30"><%=rs("username")%><input name="user_name" type="hidden" value="<%=rs("username")%>"></td></tr>
   	<tr><td width="200" align="right" height="30">新密码:</td><td width="25" height="30"></td><td width="400" height="30">
		<input name="pass1" type="password" class=input size="20"></td></tr>
   	<tr><td width="200" align="right" height="30">确认新密码:</td>
    <td width="25" height="30"></td>
    <td width="400" height="30">
	<input name="pass2" type="password" class=input size="20"></td></tr>
   	<tr><td align="center" colspan="3" height="30"><input type=submit value=下一步 name="submit1"></td></tr>
   </form>
<%end if
rs.close
set rs=nothing
%></table>
<%elseif request("action")="repass3" then%>

<table border="0" cellpadding="0" cellspacing="0" width="99%" style="border: 1px solid #C0C0C0">
<tr><td height="30" style="border-bottom: 1px solid #E1E1E1" colspan="3">&nbsp;<IMG src="Skin/<%=venshop_skin%>/home.gif" border=0 align="absmiddle"> 您的位置:  
	<a href="index.asp">首页</a> >>&nbsp;找回密码</td></tr>
<%set rs=server.createobject("adodb.recordset")	
sql="select * from venshop_user where username='"&user_name&"'"
rs.open sql,conn,1,3
if rs.eof then
response.write "<tr><td colspan=3 align=center height=100>没有这个用户,<a href=# onClick=history.go(-1)><font color=#ff0000>返回</font></a> !</td></tr>"
else
if pass1<>pass2 then
response.write "<tr><td colspan=3 align=center height=100>两次密码必须相同,请确认,<a href=# onClick=history.go(-1)><font color=#ff0000>返回</font></a> !</td></tr>"
else
rs("userpass")=pass1
rs.update
response.write "<tr><td colspan=3 align=center height=100>密码修改成功,请<a href=index.asp><font color=red>返回首页</font></a>重新登录</td></tr>"
end if
end if
rs.close
set rs=nothing%>
</table>
<%else%>

<table border="0" cellpadding="0" cellspacing="0" width="99%" style="border: 1px solid #C0C0C0">
<tr><td height="30" style="border-bottom: 1px solid #E1E1E1" colspan="3">&nbsp;<IMG src="Skin/<%=venshop_skin%>/home.gif" border=0 align="absmiddle"> 您的位置:  
	<a href="index.asp">首页</a> >>&nbsp;找回密码</td></tr>
 <form method="POST" name="form1" action="repass.asp?action=repass1">
   <tr><td height="60" colspan="3" align="center" width="100%">第一步:用户密码找回 </td></tr>
   	<tr><td align="right" height="30" width="230">请输入您的用户名:</td>
    <td align="center" height="30" width="165"><input name="user_name" type="text" class=input size="16"></td>
    <td height="30" width="230"><input type=submit value=下一步 name="submit"></td></tr>
   	<tr><td align="center" height="60" colspan="3" width="100%">注意:没有填写密码保护资料的客户无法通过此方法找回密码,请直接与<a href="mailto:<%=mail%>">管理员</a>联系!</td></tr>
</form></table>
<%end if%>

</td></tr></table></div><!--#include file="IncAsp/venshop_copy.asp"-->