请教ASP后台关于修改密码的问题!
时间:2011-08-19
来源:互联网
<%
set rs = Server.CreateObject("ADODB.Recordset")
if not IsEmpty(Request.QueryString("Action")) and Request.QueryString("Action")="Add" then
password=Trim(Request.Form("password"))
newpassword=Trim(Request.Form("newpassword"))
rs.open "Select * from services where id="&session("id"),conn,1,3
if rs.eof and rs.bof then
response.Write("<script>alert('旧密码错误!');history.go(-1);</script>")
else
rs("password")=newpassword
rs.update
rs.close
set rs=nothing:session("id")=""
session("username")=""
response.Write("<script>alert('密码修改成功,请使用新密码重新登录!');top.location='../index.asp';</script>")
end if
end if
%>
<%
rs.open "select * from services where username='"&session("username")&"'",conn,1,1
%>
<table width="750" border="0" cellpadding="5" cellspacing="1" bgcolor="#DBDBDB" class="conbody">
<form name="form1" method="post" action="?Action=Add" onSubmit="return checkdata()">
<tr>
<td bgcolor="#FAFAFA" align="right">用户名:</td>
<td align="left" bgcolor="#FAFAFA"><%=rs("username")%></td>
</tr>
<tr>
<td bgcolor="#FAFAFA" align="right">旧密码:</td>
<td align="left" bgcolor="#FAFAFA"><%=rs("password")%><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td bgcolor="#FAFAFA" align="right">新密码:</td>
<td align="left" bgcolor="#FAFAFA"><input name="newpassword" type="password" id="newpassword"></td>
</tr>
<tr>
<td bgcolor="#FAFAFA" align="right">确认密码:</td>
<td align="left" bgcolor="#FAFAFA"><input name="renewpassword" type="password" id="renewpassword" /></td>
</tr>
<tr>
<td height="22" colspan="2" align="center" bgcolor="#FAFAFA"><input type="submit" class="button" style="cursor:hand;" value="提交修改"></td>
</tr>
<input type="hidden" name="action" value="abc">
</form>
</table>
</td>
</tr>
</table>
<%call connclear()%>
始终没有找到原因在哪里 一直提示原始密码错误 请高手赐教!
set rs = Server.CreateObject("ADODB.Recordset")
if not IsEmpty(Request.QueryString("Action")) and Request.QueryString("Action")="Add" then
password=Trim(Request.Form("password"))
newpassword=Trim(Request.Form("newpassword"))
rs.open "Select * from services where id="&session("id"),conn,1,3
if rs.eof and rs.bof then
response.Write("<script>alert('旧密码错误!');history.go(-1);</script>")
else
rs("password")=newpassword
rs.update
rs.close
set rs=nothing:session("id")=""
session("username")=""
response.Write("<script>alert('密码修改成功,请使用新密码重新登录!');top.location='../index.asp';</script>")
end if
end if
%>
<%
rs.open "select * from services where username='"&session("username")&"'",conn,1,1
%>
<table width="750" border="0" cellpadding="5" cellspacing="1" bgcolor="#DBDBDB" class="conbody">
<form name="form1" method="post" action="?Action=Add" onSubmit="return checkdata()">
<tr>
<td bgcolor="#FAFAFA" align="right">用户名:</td>
<td align="left" bgcolor="#FAFAFA"><%=rs("username")%></td>
</tr>
<tr>
<td bgcolor="#FAFAFA" align="right">旧密码:</td>
<td align="left" bgcolor="#FAFAFA"><%=rs("password")%><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td bgcolor="#FAFAFA" align="right">新密码:</td>
<td align="left" bgcolor="#FAFAFA"><input name="newpassword" type="password" id="newpassword"></td>
</tr>
<tr>
<td bgcolor="#FAFAFA" align="right">确认密码:</td>
<td align="left" bgcolor="#FAFAFA"><input name="renewpassword" type="password" id="renewpassword" /></td>
</tr>
<tr>
<td height="22" colspan="2" align="center" bgcolor="#FAFAFA"><input type="submit" class="button" style="cursor:hand;" value="提交修改"></td>
</tr>
<input type="hidden" name="action" value="abc">
</form>
</table>
</td>
</tr>
</table>
<%call connclear()%>
始终没有找到原因在哪里 一直提示原始密码错误 请高手赐教!
作者: ahhnzhao 发布时间: 2011-08-19
输出一下sql语句。看看。
作者: lihuiluhuijie 发布时间: 2011-08-19
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28