<!--#include file="conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="../webconfig.asp"-->
<!--#include file="../fuction.asp"-->

<!--#include file="../webtop.asp"-->

<table width="1000" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="6" colspan="3"></td>
  </tr>
  <tr>
    <td width="20"></td>
    <td valign="bottom"><img src="<%=weburl%>images/arrow01.gif" width="11" height="11" /> Your present position: <a href="<%=weburl%>"><%=webname%></a> -> <span class="table-shangxia"><span class="b14"><a href=index.asp><%=bbsname%></a> → 找回密码</span></span></td>
    <td valign="bottom"></td>
  </tr>
  <tr>
    <td height="6" colspan="3"></td>
  </tr>
</table>
<!--#include file="top.asp"-->
<!--#include file="inc/md5.asp"-->
<html>
<head>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td>
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td valign="top">
            <p>&nbsp;</p>
            <%menu=request.querystring("menu")             
select case menu             
case""             
%>
            <table width="738" border="0" align="center" cellpadding="5" cellspacing="0">
              <form method="POST" action="?menu=getname"> <tr>
                
                  <td><br>
&nbsp;请输入用户名：
        <input name="username" type="text" class="wenbenkuang" id="username" size="21">
                  </td>
                
              </tr>
              <tr>
                <td colspan="2">
                  <input type="submit" value="提交" name="B12" class="go-wenbenkuang">
                  <input type="reset" value="重写" name="B22" class="go-wenbenkuang">
                </td>
              </tr></form>
              <tr>
                <td width="706" colspan="2">&nbsp; </td>
              </tr>
            </table>
            <%case"getname"             
getpassword=true             
username=nosql(trim(Request.Form("username")))            
set rs=conn.execute("select Quesion from [shop_user] where username='"&username&"'")             
if rs.eof then
response.write"<script language='javascript'>alert('该用户不存在！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
else             
Quesion=rs("Quesion")           
 %>
            <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
             <form method="POST" action="?menu=get"> <tr>
                <td>用户名：
                  <input type="hidden" name="username" size="20" value="<%=username%>"><%=username%></td>
              </tr>
              <tr>
                <td>问题：<%=Quesion%></td>
              </tr>
              <tr>
                <td>请输入答案：
                  <input name="anser" type="text" class="wenbenkuang" size="21"></td>
              </tr>
              <tr>
                <td>&nbsp;<input type="submit" value="提交" name="B1" class="go-wenbenkuang">
                <input type="reset" value="重写" name="B2" class="go-wenbenkuang"> </td>
              </tr>
             </form>
            </table> <%end if %>        
<% case"get"           
username=trim(Request.Form("username"))           
anser=trim(Request.Form("anser"))           
           
set rs=conn.execute("select * from [shop_user] where username='"&username&"' and Answer='"&md5(anser)&"'")           
if rs.eof then
response.write"<script language='javascript'>alert('答案错误！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"%>       
<%else         
%> 
<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
 <form method="POST" action="?menu=change"> <tr>
    <td>&nbsp; <input type="hidden" name="username" size="20" value="<%=username%>"><input type="hidden" name="anser" size="20" value="<%=anser%>">
      新密码：<input name="newpass" type="text" class="wenbenkuang" size="21"></td>
  </tr>
  <tr>
    <td>&nbsp; 确认新密码：
      <input name="repwd" type="text" class="wenbenkuang" size="21"></td>
  </tr>
  <tr>
    <td>&nbsp;<input type="submit" value="提交" name="B1" class="go-wenbenkuang">
    <input type="reset" value="重写" name="B2" class="go-wenbenkuang"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr></form>
</table>                               
          <%end if%>      
          <%case"change"         
username=nosql(trim(Request.Form("username")))         
anser=nosql(trim(Request.Form("anser")))         
newpass=nosql(trim(Request.Form("newpass")))         
repwd=nosql(trim(Request.Form("repwd")))         
function strLength(str)         
       ON ERROR RESUME NEXT         
       dim WINNT_CHINESE         
       WINNT_CHINESE    = (len("论坛")=2)         
       if WINNT_CHINESE then         
          dim l,t,c         
          dim i         
          l=len(str)         
          t=l         
          for i=1 to l         
             c=asc(mid(str,i,1))         
             if c<0 then c=c+65536         
             if c>255 then         
                t=t+1         
             end if         
          next         
          strLength=t         
       else          
          strLength=len(str)         
       end if         
       if err.number<>0 then err.clear         
end function         
if isnull(newpass) or newpass="" or strlength(newpass)>16 or Instr(newpass,"=")>0 or Instr(newpass,"%")>0 or Instr(newpass,chr(32))>0 or Instr(newpass,"?")>0 or Instr(newpass,"&")>0 or Instr(newpwd,";")>0 or Instr(newpass,",")>0 or Instr(newpass,"'")>0 or Instr(newpass,",")>0 or Instr(newpass,chr(34))>0 or Instr(newpass,chr(9))>0 or Instr(newpass,"")>0 or Instr(newpass,"$")>0 then         

response.write"<script language='javascript'>alert('你的密码含有非法字符！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"    
elseif newpass<>repwd then      

response.write"<script language='javascript'>alert('你的重复密码与原密码不相同！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"       
else         
conn.execute("update [shop_user] set userpassword='"&md5(newpass)&"' where username='"&username&"'")         
response.write"<script language='javascript'>alert('密码修改成功！')</script>"
response.write "<script language='javascript'>window.location='index.asp'</script>"           
end if         
set rs=nothing        
end select%>   <p>&nbsp;</p></td>
        </tr>
    </table></td>
  </tr>
</table>
<!--#include file="../copyright.asp"-->                                                                                      
    </td>                                                                            
  </tr>                                                                            
</table>                                                                            
