⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getpwd.asp

📁 多用户个人主页系统(ASP)
💻 ASP
字号:
<!--#include file="inc/CONN.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/md5.asp"--> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="inc/style.css"-->
<script language=javascript src="inc/js.inc"></script>
<title>找回密码</title>
</head>
<body <%=skin(13)%>>
<BR>
<%sub inputname()%>
<table align=center border=1 bordercolor=<%=skin(11)%> cellpadding=3 cellspacing=0 width="480">
	<form name=getpass1 action="getpwd.asp" method=post onsubmit="submitonce(this)">
		<input type=hidden name=action value=chkname>
		<tr align="center" class=titlestyle> 
			<Td colspan=2><B>填写你已注册的名字</b></td>
		</tr>
		<tr bgcolor=<%=skin(5)%>>
			<td width=150 align=right>用户名:</td>
			<Td width=*> <input name=username type=text maxlength=16 size=18 value=<%=request("username")%>></td>
		</tr>
		<tr bgcolor=<%=skin(4)%>> 
			<td align=right></td>
			<Td> <INPUT name=submit type=submit value="提交">  <INPUT name="reset" type=reset  value="关闭" title=关闭窗口 onclick="javascript:window.close()"></td>
		</tr>
	</form>
</table>
<%end sub%>

<%sub inputanswer()%>
<table align=center border=1 bordercolor=<%=skin(11)%> cellpadding=3 cellspacing=0 width="480">
	<form name=getpass2 action="getpwd.asp" method=post onsubmit="submitonce(this)">
		<tr align="center" class=titlestyle> 
			<Td colspan=2><B>填写提示问题的答案</b></td>
		</tr>
		<tr bgcolor=<%=skin(5)%>>
			<input type=hidden name=action value=chkanswer>
			<input type=hidden name=username value=<%=username%>>
			<td width=150 align=right>问 题:</td>
			<Td width=*> <%=rs("question")%></td>
		</tr>
		<tr bgcolor=<%=skin(5)%>> 
			<td align=right>答 案:</td>
			<Td width=*> <input name=answer type=text maxlength=15 size=18></td>
		</tr>
		<tr bgcolor=<%=skin(4)%>> 
			<td align=right></td>
			<Td> <INPUT name=submit type=submit value="提交">  <INPUT name="reset" type=reset value="取消" onclick="javascript:window.close()"></td>
		</tr>
	</form>
</table>
<%end sub%>

<%sub inputpwd()%>
<table align=center border=1 bordercolor=<%=skin(11)%> cellpadding=3 cellspacing=0 width="480">
	<form name=getpass2 action="getpwd.asp" method=post onsubmit="submitonce(this)">
		<tr align="center" class=titlestyle> 
			<Td colspan=2><B>填写新密码</b></td>
		</tr>
		<input type=hidden name=action value=updatepwd>
		<input type=hidden name=username value=<%=username%>>
		<tr bgcolor=<%=skin(5)%>> 
			<td width=150 align=right>新密码:</td>
			<Td width=*> <input name=userpass type=text maxlength=15 size=18 style="ime-mode:disabled" onpaste="return false"></td>
		</tr>
		<tr bgcolor=<%=skin(4)%>> 
			<td align=right></td>
			<Td> <INPUT name=submit type=submit value="提交">  <INPUT name="reset" type=reset value="取消" onclick="javascript:window.close()"></td>
		</tr>
	</form>
</table>
<%end sub%>

<%
username=request.form("username")
select case request.form("action")
case "chkname"
	set rs=conn.execute("select userid from [user] where username='"&username&"'")
	if rs.bof then
		response.write "<script language=javascript>alert( ""没有这个用户名"");"&Chr(13)&"location.href=""javascript:history.back()"";</script>"
		response.end
		rs.close
	else
		set rs=conn.execute("select question from [user] where username='"&username&"'")
		call inputanswer()
		rs.close
	end if
case "chkanswer"
	set rs=conn.execute("select answer from [user] where username='"&username&"'")
	if md5(request.form("answer"))<>rs(0) then
		response.write "<script language=javascript>alert( ""答案填写错误"");"&Chr(13)&"location.href=""javascript:history.back()"";</script>"
		response.end
		rs.close
	else
		call inputpwd()
	end if
case "updatepwd"
	conn.execute("update [user] set userpass='"&md5(request.form("userpass"))&"' where username='"&username&"'")
	if cfg(7) then
		mailbody=mailbody+"注册名:"+username+"<BR>"
		mailbody=mailbody+"新密码:"+request.form("userpass")+"<BR>"
		mailbody=mailbody+"留言本:<a href=http://"+request("http_host")
		mailbody=mailbody+left(request("script_name"),int(len(request("script_name"))-7))
		mailbody=mailbody+"index.asp?username="+username+" target=blank>"
		mailbody=mailbody+"http://"+request("http_host")
		mailbody=mailbody+left(request("script_name"),int(len(request("script_name"))-7))
		mailbody=mailbody+"index.asp?username="+username
		mailbody=mailbody+"</a>"
		set objmail = Server.createobject("CDONTS.Newmail")
		objmail.to		= usermail
		objmail.from		= Serveremail
		objmail.subject		= "您的留言本密码已更改"
		objmail.mailformat	= 0
		objmail.bodyformat	= 0
		objmail.body		= mailbody
		objmail.send 
		set objmail = nothing
		if err.number<>0 then
			tempstr=",由于smtp服务出错,未能发送邮件"
			err.clear()
		else
			tempstr=",已经将注册信息发往您的信箱"
		end if
	end if
	response.write "<script language=javascript>alert( ""新密码已经确认"&tempstr&""");"&Chr(13)&"location.href=""javascript:window.close()"";</script>"
	response.write "新密码已经确认"&tempstr&"。<a href=javascript:window.close()>关闭窗口</a>"
case else
	call inputname()
end select
%>
<!--#include file="inc/foot.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -