<% on error resume next %>
<!--#include virtual="/incs/config.asp"-->
<!--#include virtual="/incs/md5.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''检验表单
usrname=trim(SafeRequestform("usrname"))
usrmail=trim(SafeRequestform("usrmail"))
recs=chk_usrpss(usrname,"会员名称",4,16)
if chk_email(usrmail)=false then
call errorpage(-2,"对不起，电子邮箱格式有误！")
end if
'''''''''''''''''''''''''''''''''''''''''''''''检验用户
conn.open constr
query="select u_eml,u_id,u_sys from memlst where u_nme='"&usrname&"'"
rs.open query,conn,1,1
if rs.recordcount<>1 then
   call errorpage(-2,"对不起，该会员不存在！")
elseif rs("u_sys")<>"0" and rs("u_sys")<>"1"  then
   call errorpage(-2,"对不起，该会员属于高级用户，请与本站联系取回密码！")
else
   u_eml=trim(rs("u_eml"))
   email=u_eml
   if u_eml="" then   
      call errorpage(-2,"对不起，该会员申请时没有填写邮箱！")
   elseif u_eml<>usrmail then
      call errorpage(-2,"对不起，您所填写的信箱与该会员的联系信箱不符！")
   end if
end if
u_id=rs("u_id")
rs.close
'''''''''''''''''''''''''''''''''''''''''''''''生成密码 
newpass=pss_mak(8)
newpass_str=newpass
newpass=md5(newpass)

'''''''''''''''''''''''''''''''''''''''''''''''更改密码 
query="update memlst set u_pss='"&newpass&"' where u_id="&u_id
conn.execute query,1,1

''''''''''''''''''''''''''''''''''''''''''
paras=paras&"u_nme:"&usrname&Vend
paras=paras&"u_pss:"&newpass_str&Vend
mailtag="usr_pss"

recs=jmail_feedback(usrmail,mailtag,paras,true)
''''''''''''''''''''''''''''''''''''''''''

if recs=true then
	call infpage( "恭喜您，您的密码已经成功发送到邮箱"&usrmail,"/")
else
call errorpage(-2,"对不起，您的密码发送失败！")
end if
%>

