<!--#include file="../Inc/Cls_DB.asp" -->
<!--#include file="../Inc/Const.asp" -->
<!--#include file="../Inc/Md5.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing

if request.form("action")="modify" then

if  Replace(Trim(Request.Form("password")),"'","''") =""  then 
		Response.Write("<script>alert(""密码不能为空！"");location=""Javascript:history.go(-1)"";</script>")
		Response.End
end if

if  Replace(Trim(Request.Form("password")),"'","''") <> Replace(Trim(Request.Form("password1")),"'","''")  then
		Response.Write("<script>alert(""2次密码不相同，请重新输入！"");location=""Javascript:history.go(-1)"";</script>")
		Response.End
end if
set RsMemObj = Server.CreateObject ("ADODB.RecordSet")
RsMemObj.Source="select * from Members where ID="& CLNG(Request.Form("MemID"))
RsMemObj.Open RsMemObj.Source,Conn,1,3
RsMemObj("password") = md5(Replace(Trim(Request.Form("password")),"'","''"),16)
rsMemObj.update
Response.Write("<script>alert(""修改密码成功！"");location=""UserLogin.asp"";</script>")  
Response.End
end if
%>
<html>
<head>
<link href="../CSS/css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>找回密码</title>
</head>
<body>
<table width="80%" border="0" align="center" cellpadding="5" cellspacing="1" bordercolor="e6e6e6" bgcolor="#B6B6B6">
  <tr> 
    <td height="24" bgcolor="#DFDFDF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用户找回密码>>第三步:修改密码</td>
  </tr>
</table>
<br>
<%
set RsMemObj = Server.CreateObject ("ADODB.RecordSet")
RsMemObj.Source="select * from Members where MemName='"& Replace(Trim(Request.Form("MemName")),"'","''") &"' and PassAnswer='"& Replace(Trim(Request.Form("PassAnswer")),"'","''") &"'and email='"& Replace(Trim(Request.Form("email")),"'","''") &"'"
RsMemObj.Open RsMemObj.Source,Conn,1,1
if Not RsMemObj.eof then
Call main()
else
Call Nonerecode()
end if
sub main()%>
<form name="form1" method="post" action="">
          
  <table width="80%" border="0" align="center" cellpadding="5" cellspacing="1" bordercolor="e6e6e6" bgcolor="#B6B6B6">
    <tr bgcolor="#FFFFFF"> 
      <td width="21%"><div align="right">修改密码：</div></td>
      <td width="79%"><font color="#FF0000"> 
        <input name="action" type="hidden" id="action" value="modify">
        <input name="MemID" type="hidden" value="<%=RsMemObj("ID")%>">
        <input name="Password" type="password" id="Password">
        </font><a href="UserLogin.asp"><font color="#0000FF"> </font></a></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td><div align="right">确认密码：</div></td>
      <td><font color="#FF0000"> 
        <input name="Password1" type="password" id="Password1">
        </font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td>&nbsp;</td>
      <td><a href="UserLogin.asp"><font color="#0000FF"> 
        <input type="submit" name="Submit" value="修改">
        </font></a></td>
    </tr>
    <tr bgcolor="#DFDFDF"> 
      <td colspan="2"> 
        <div align="center"><%
		Dim Rsconfig
		set Rsconfig=conn.execute("select * from config")
		Response.Write(""&Rsconfig("Copyright")&"")
		Rsconfig.close
		set Rsconfig=nothing
		%>
        </div></td>
    </tr>
  </table>
      </form>
	  <%end sub%>
	  <%sub Nonerecode()%>
	  <table width="80%" border="0" align="center" cellpadding="5" cellspacing="1" bordercolor="e6e6e6" bgcolor="e6e6e6">
	    <tr><td bgcolor="#FFFFFF">
	  <%response.Write("你输入资料不正确，请重新输入！。")%>
		</td></tr></table>
	  <%end sub%>
</body>
</html>

