📄 u_modifypsw.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file="md5.asp"-->
<!--#include file="inc/chkinput.asp"-->
<%
'=========================================================
' File: u_modifypsw.asp
' Date: 2006-04-062
' Script Written by Leibo
'=========================================================
' Copyright (C) 2002,2008 Mathren.com. All rights reserved.
' Web: http://www.hrbyydz.com
' Email: qa_90@hotmail.com
'=========================================================
response.buffer=true
stats="修改密码"
dim psw
dim oldpassword
if not founduser then
Errmsg=Errmsg+"<br>"+"<li>您还没有登陆,请登陆后进行修改。"
founderr=true
end if
call head()
if founderr then
errmsg=errmsg+"<br>"+"<li>您没有<a href=login.asp target=_blank>登录</a>。"
call head_var("","")
call txl_error()
else
call head_var("个人菜单","u_index.asp")
if request("action")="update" then
call update()
if founderr then
call txl_error()
else
sucmsg="<li>修改密码成功!"
call txl_suc()
end if
else
call userinfo()
end if
end if
call foot()
sub userinfo()
set rs=server.createobject("adodb.recordset")
sql="Select * from [User] where userid="&userid
rs.open sql,conn,1,1
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
founderr=true
exit sub
end if
%>
<table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">
<tr>
<td bgcolor=<%=txl_body(10)%> align="center" valign="top"><br>
<table cellpaddin=3 cellspacing=1 class=tableborder1 width=<%=txl_body(19)%> align=center>
<tr>
<th width=14% height=25 id=tabletitlelink><a href=u_index.asp>个人菜单首页</a></th>
<th width=14% id=tabletitlelink><a href=u_modifymy.asp>基本资料修改</a></th>
<th width=14% id=tabletitlelink><a href=u_modifypsw.asp>用户密码修改</a></th>
<th width=14% id=tabletitlelink><a href=u_modifyadd.asp>联系资料修改</a></th>
<th width=14% id=tabletitlelink><a href=u_myskin.asp>选择界面风格</a></th>
<th width=14% id=tabletitlelink><a href=usersms.asp>我的短信管理</a></th>
<th width=14% id=tabletitlelink><a href=d_index.asp>我的日记管理</a></th>
</tr>
</table>
<br>
<table cellpadding=5 cellspacing=1 border=0 class=tableborder1 width=<%=txl_body(19)%> align=center>
<form action="u_modifypsw.asp?action=update&username=<%=htmlencode(membername)%>" method=POST name="theForm">
<tr>
<th height=25 colspan=2>用户密码修改</td>
</tr>
<tr>
<td width="40%" class=tablebody1><B>旧密码确认</B>:<BR>只有先输入旧密码才能进行修改</td>
<td width="60%" class=tablebody1> <input type="password" name="oldpsw" value="" size=30 maxlength=13> </td>
</tr>
<tr>
<td width="40%" class=tablebody1><B>新密码确认</B>:<BR>如要修改请直接输入新密码进入更新</td>
<td width="60%" class=tablebody1> <input type="password" name="psw" value="" size=30 maxlength=13> </td>
</tr>
<tr>
<td width="40%" class=tablebody1><B>密码问题</B>:<BR>请填写做为密码答案依据</td>
<td width="60%" class=tablebody1> <input type=text name="question" size=30 value="<%=htmlencode(rs("question"))%>"></td>
</tr>
<tr>
<td width="40%" class=tablebody1><B>问题答案</B>:<BR>请认真填写以便您日后取回密码<BR>答案采用了MD5加密,只供取回密码使用,如要修改可直接填写。</td>
<td width="60%" class=tablebody1> <input type=text name="answer" size=30 value="<%=htmlencode(rs("answer"))%>"><input type=hidden name="oldanswer" value="<%=htmlencode(rs("answer"))%>"></td>
</tr>
<tr>
<td colspan="2" width="100%" class=tablebody2 align="center"><input type=Submit value="更 新" name="Submit"> <input type="reset" name="Submit2" value="清 除"></td>
</tr>
</form>
</table><br>
</td>
</tr>
</table>
<%
rs.close
set rs=nothing
end sub
sub update()
set rs=server.createobject("adodb.recordset")
sql="Select password from [User] where userid="&userid
set rs=conn.execute(sql)
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
founderr=true
exit sub
else
if request("oldpsw")="" then
errmsg=errmsg+"<br>"+"<li>请输入您的旧密码,才能完成修改。"
founderr=true
exit sub
elseif md5(trim(request("oldpsw")))<>trim(rs("password")) then
errmsg=errmsg+"<br>"+"<li>输入的旧密码错误,请重新输入。"
founderr=true
exit sub
else
oldpassword=request("oldpsw")
end if
if request("psw")<>"" then
password=md5(request("psw"))
else
password=rs("password")
end if
if request("question")="" then
errmsg=errmsg+"<br>"+"<li>请输入密码提示问题。"
founderr=true
exit sub
else
question=request("question")
end if
if request("answer")="" then
errmsg=errmsg+"<br>"+"<li>请输入密码提示问题答案。"
founderr=true
exit sub
elseif request("answer")=request("oldanswer") then
answer=request("answer")
else
answer=md5(request("answer"))
end if
end if
set rs=server.createobject("adodb.recordset")
sql="Select * from [User] where userid="&userid
rs.open sql,conn,1,3
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
founderr=true
exit sub
else
rs("password")=password
rs("question")=question
rs("answer")=answer
rs.Update
Response.Cookies("mathren")("password") = password
Response.Cookies("mathren").path=cookiepath
end if
rs.close
set rs=nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -