domodifypwd.asp

来自「一个学生信息管理网站」· ASP 代码 · 共 37 行

ASP
37
字号
<!--#include file="..\inc\conn.asp"-->
<!--#include file="..\inc\SessionCheck.asp"-->
<link rel="stylesheet" href="..\inc\style.css" type="text/css">
<%
Call DBConnBegin()
dim id,oldpwd,newpwd1,newpwd2
id=Request.Form("uid")
oldpwd=Request.Form("oldpwd")
newpwd1=Request.Form("newpwd1")
newpwd2=Request.Form("newpwd2")
if id="" then
  Response.write "没有密码需要修改!<a href='modifypwd.asp?id="&CStr(id)&"' class='link'>返回密码修改</a>&nbsp;<a href='usermanage.asp' class='link'>返回用户列表</a>"
  Response.end
end if
if oldpwd="" or newpwd1="" or newpwd2="" then
  Response.write "密码不能为空!<a href='modifypwd.asp?id="&CStr(id)&"' class='link'>返回密码修改</a>&nbsp;<a href='usermanage.asp' class='link'>返回用户列表</a>"
  Response.end
end if
if newpwd1<>newpwd2 then
  Response.write "新密码输入不一致!<a href='modifypwd.asp?id="&CStr(id)&"' class='link'>返回密码修改</a>&nbsp;<a href='usermanage.asp' class='link'>返回用户列表</a>"
  Response.end
end if
'验证密码
sSql="select * from UserInfo where UserPwd='"&trim(oldpwd)&"' and [id]="&CStr(id)
oRs.open sSql,oConn,3,2
if oRs.bof and oRs.eof then
  Response.write "旧密码输入错误!<a href='modifypwd.asp?id="&CStr(id)&"' class='link'>返回密码修改</a>&nbsp;<a href='usermanage.asp' class='link'>返回用户列表</a>"
  Call DBConnEnd()
  Response.end
end if
oRs.close

sSql="update UserInfo set UserPwd='"&trim(newpwd1)&"' where [id]="&CStr(id)
oRs.open sSql,oConn,1,1
Call DBConnEnd()
Response.write "修改成功!&nbsp;<a href='usermanage.asp' class='link'>返回用户列表</a>"
%>

⌨️ 快捷键说明

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