<!--#include file="Head.asp"-->
<!--#include file="../Include/Md5.asp" -->
<%
dim Step,rsTemp
Step=request.QueryString("Step")
%>
<div align="center">
  <table width="950" border="0" cellspacing="0" cellpadding="0" class="Outside">
    <tr>
      <td width="240" height="500" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="200" height="25"><table width="215" border="0" align="center" cellpadding="1" cellspacing="0">
            <tr>
              <td width="215" height="38" background="../Images/VoteMenu.jpg"><div style="margin-left:90px;"><b><font color="#FFFFFF">会员中心</font></b></div></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="center"></td>
        </tr>
        <tr>
          <td align="center"><%if vex=1 then%>
            <% =WebMenu() %>
            <%else%>
            <% =WebMenv() %>
            <% end if %></td>
        </tr>
        <tr>
          <td height="30">&nbsp;</td>
        </tr>
      </table>
        <!--#include file="tabmenu.asp"-->
		</td>
      <td width="1" bgcolor="#C5D7DB"></td>
      <td valign="top" class="AllCenter"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="30" height="25" align="center" bgcolor="#F4F4F4"><img src="../Images/Arrow_01.gif" width="14" height="11"></td>
          <td bgcolor="#F4F4F4" class="Location"><a href="../index.asp">首页</a><img src="../Images/Arrow_02.gif" width="13" height="12" align="absmiddle"><a href='MemberCenter.asp'>会员中心</a><img src="../Images/Arrow_02.gif" width="13" height="12" align="absmiddle">找回密码</td>
          </tr>
        <tr>
          <td height="4" colspan="2" bgcolor="#FFFFFF"></td>
        </tr>
      </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="30" height="20">&nbsp;</td>
            <td>&nbsp;</td>
            <td width="30">&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>
			<%if Step="" then%>
			<table width="604" border="0" cellspacing="0" cellpadding="0">
			  <form name="form" method="post" action="MemberLost.asp?Step=EnterNameMail">
              <tr>
                <td width="240" align="right">                
                登&nbsp;录&nbsp;名：       				</td>
                <td width="384"><input name="MemName" type="text" class="TextBox" id="MemName" size="30" maxlength="16"></td>
              </tr>
              <tr>
                <td align="right">                
                电子邮箱：       				</td>
                <td><input name="Email" type="text" class="TextBox" id="Email" size="30" maxlength="50"></td>
              </tr>
			  <tr>
                <td height="60" colspan="2" align="center"><input name="Next" type="submit" class="button" value=" 下一步 "></td>
              </tr>
			  </form>
            </table>
			<%
			elseif Step="EnterNameMail" then
			  set rsTemp = conn.execute("select * from ameav_Members where MemName='"&request.form("MemName")&"' and Email='"&request.form("Email")&"'")
			  if rsTemp.bof and rsTemp.eof then
			    WriteMsg("·登录名和电子邮箱不存在或不对应，请返回重新输入。")
			    response.end
			  end if
		    %>
			<table width="604" border="0" cellspacing="0" cellpadding="0">
			  <form name="form" method="post" action="MemberLost.asp?Step=EnterAnswer&ID=<%=rsTemp("ID")%>">
              <tr>
                <td width="240" align="right">登&nbsp;录&nbsp;名：</td>
                <td width="384"><%=rsTemp("MemName")%></td>
              </tr>
              <tr>
                <td align="right">电子邮箱：</td>
                <td><%=rsTemp("Email")%></td>
              </tr>
              <tr>
                <td align="right">密码提示问题：</td>
                <td><%=rsTemp("Question")%></td>
              </tr>
              <tr>
                <td align="right">密码提示答案：</td>
                <td><input name="Answer" type="text" class="TextBox" size="30" maxlength="100"></td>
              </tr>
			  <tr>
                <td height="60" colspan="2" align="center"><input name="Next" type="submit" class="button" value=" 下一步 "></td>
              </tr>
			  </form>
            </table>
			<%
			elseif Step="EnterAnswer" then
			  set rsTemp = server.CreateObject("adodb.recordset")
			  rsTemp.open "select * from ameav_Members where ID="&request.QueryString("ID")&"",conn,1,3
			  if rsTemp.bof and rsTemp.eof then
			    WriteMsg("·数据读取异常错误。")
			    response.end
			  end if
              if rsTemp("Answer")<>MD5(trim(request("Answer"))) then
                WriteMsg("·输入的密码提示答案不正确。")
	            response.End()
             end if
             dim NewPassword
             randomize timer
             NewPassword=Int(899999*Rnd() +100000)
             rsTemp("Password")=MD5(NewPassword)
             rsTemp.update
             rsTemp.close
             set rsTemp=nothing  
             WriteMsg("·你的新密码是<font color='red'>"&NewPassword&"</font>，请记住密码或登录修改成易记、安全的密码。")
             response.end()
		   end if
           %>			</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td height="30"></td>
            <td></td>
            <td></td>
          </tr>
        </table></td>
    </tr>
  </table>
</div>
<%

sub FindStep()

end sub

function MemGroup(GroupID)
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select * from ameav_MemGroup where GroupID='"&GroupID&"'"
  rs.open sql,conn,1,1
  MemGroup=rs("GroupName")
  rs.close
  set rs=nothing
end function
%>
<!--#include file="Foot.asp"-->