<!--#include file="inc/conn.asp"-->
<!--#include file="inc/inc.asp"-->
<!--#include file="mail.asp"-->
<!--#include file="inc/ipt.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=title%>-找会密码</title>
<script>
function loadThreadFollow(t_id,b_id){
	var targetImg =eval("document.all.followImg" + t_id);
	var targetDiv =eval("document.all.follow" + t_id);
	
	if ("object"==typeof(targetImg)){
		if (targetDiv.style.display!='block'){
			targetDiv.style.display="block";
			
		}else{
			targetDiv.style.display="none";
		}
	}
}
</script>
<SCRIPT language=javascript>
<!--
function CheckloginForm()
{
if(document.thisForm.username.value.length<1)
	{
	    alert("登陆帐号没有填写!");
	    return false;
	}
if(document.thisForm.email.value.length<1)
	{
	    alert("注册时电子邮箱请务必填写!");
	    return false;
	}
}

//-->
</SCRIPT>
</head>
<body topmargin="0">
<%call t()%><DIV class=h></DIV>
<div align="center">
<table width="760" id="table1" style="padding:1px; border-collapse:collapse" cellpadding="0">
<tr>
<td width="70%" height="300" class="td" valign="top">
<%
dim pass,uname,nemail,zjid
uname=trim(Request.form("username"))
email=trim(Request.form("email"))
nemail=trim(Request.form("nemail"))
zjid=trim(Request.form("zjid"))
m=Request.form("m")
if m<>"" or username<>"" or email<>"" then

'随机生产密码
i=6
function gen_key(digits)
dim rndnum,num
Randomize
Do while Len(rndnum)<digits
num = Cstr(Chr((57-48)*rnd+48))
rndnum = rndnum & num
Loop
gen_key = rndnum
End function
'Response.write gen_key(i)
pass=gen_key(i)

if request.cookies("cnmai")("errs")="" then
k=0
else
k=request.cookies("cnmai")("errs")
end if
if request.cookies("cnmai")("errs")>30 then
Response.Write "<script language='javascript'>alert('您取回新密码的次数已经超过3次,系统保护中,请稍后再试！');history.back();</script>" 
response.end
end if

set rs=server.createobject("adodb.recordset")
if Request.form("user")="g" then
sql="select * from [jle_user] where username='"&uname&"' and email='"&email&"'"
else
sql="select * from [jle_com] where username='"&uname&"' and email='"&email&"'"
end if
rs.open sql,conn,1,3
if rs.eof and rs.bof then
Response.cookies("cnmai")("errs")=k+1
Response.Write "<script language='javascript'>alert('您的用户名或注册时电子邮箱不相符！');history.back();</script>" 
response.end
else
rs("password")=md5(pass)
rs.update
if nemail<>"" and zjid=rs("idcard") then
email=nemail
call mail()
response.write "<br><br><p align=center><font size=4><li>您的密码已经发送到|<b>"&email&"</b>|，请注意查收！</font></p>"
else
Response.Write "<script language='javascript'>alert('相关证件号码与您注册时填写的证件号码不相符！');history.back();</script>" 
end if
sub mail()
dim mailbody,Jmail
mailbody="您好,"&username&"!<br>您已成功取回了新的密码！现在资料为：登陆帐号：[<b>"&uname&"</b>] 您的新密码是：[<b>"&pass&"</b>]<br> 请及时登陆<a target=_blank  href="&web&">"&title&""&web&"</a>修改为您的密码！<br>感谢您使用我们<a target=_blank  href="&web&">"&title&"</a>为您提供的真诚服务！<br>["&title&"]打造全国最大、最专业的二手信息发布平台<br>服务热线:029-83732767   QQ:88324655"   '邮件内容
Set Jmail=server.createobject("Jmail.Message")
Jmail.Charset ="gb2312"
JMail.ContentType = "text/html"
Jmail.Silent =true
Jmail.Priority = 3
Jmail.MailServerUserName = mailname
Jmail.MailServerPassword = mailpass
Jmail.From = mailform
Jmail.FromName =""&title&""
Jmail.Subject ="您的新密码！-"&title&""
Jmail.AddRecipient ""&email&""
Jmail.Body = mailbody
Jmail.Send(mailsmtp)
Set Jmail=nothing
end sub

end if
rs.close
set rs=nothing
closedb

else
%>
<form id="f1" name="thisForm" action="?" method="POST" style="line-height: 100%; margin-top: 0; margin-bottom: 0">
<div align="center">
<table width="100%" cellpadding="0" style="border-collapse: collapse" id="table8" height="115%" ><tr>
<td class=td1 colspan="2">&nbsp;位置导航：<a href="/">首页</a>→找回密码</tr>
<tr>
<td class=tdh rowspan="10" width="14%">　</tr>
<td height="33" align="center" width="86%">如果您的登陆密码忘记了,你可以通过如下方式重新设置您的密码</tr>
<tr>
<td height="33" align="center" width="86%">
<input type="radio" value="g" name="user" checked>个人用户 
<input type="radio" value="s" name="user">商家用户</tr>
<tr>
<td height="33" align="center" width="86%">&nbsp; 登陆帐号：<input maxLength="20" size="19" name="username"> 
*</tr>
<tr>
<td height="33" align="center" width="86%">注册时邮箱：<input maxLength="32" size="19" name="email"> 
* </tr>
<tr>
<td height="33" align="center" width="86%"><span id="followImg1" style="CURSOR: hand" title="点击填写新的电子邮箱,原注册时邮箱务必填写" onclick="loadThreadFollow(1,5)">原注册时电子邮箱失效或忘记密码,<u><font color="#0066CC">填写新邮箱</font></u></span></tr>
<tr  style="display:none" id="follow1">
<td height="33" align="center" width="86%">&nbsp;&nbsp;&nbsp; 新的邮箱：<input id="password2" maxLength="32" size="19" name="nemail"> 
*<br><br>相关证件号码：<input id="zj" maxLength="32" size="19" name="zjid"> 
*<br><font color="#FF0000">请正确填写您注册时候的相关证件号码,否则无法使用该项</font></tr>
<tr>
<td height="50" width="86%"><p align="center">&nbsp;&nbsp;<input type="hidden" name="login" value="cnmai"><input  onclick="javascript:return CheckloginForm();" type="submit" value="我要取回新密码" name="m" style="font-size: 10pt; "></td></tr><tr>
<td height="25" align="center" width="86%">
如果您无法通过上述方法修复密码，请您和<a href="ab_book.asp">客户留言</a>留下您的问题。<br>
联系电话：029-83732767</td></tr><tr>
<td width="86%">
　</td></tr></table>
</div>
</form>
<%end if%></td>
<td valign="top" width="3%">
　</td>
<td width="25%" class="td">
　</td>
</tr>
</table>
</div>
<!--#include file="foot.asp"-->
</body>
</html>