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

📄 domodifypwd.asp

📁 一个基于ASP和SQL数据库的学生信息管理系统,可以方便的实现学生信息的添加修改和删除,成绩信息的管理和学生的在线选课.
💻 ASP
字号:
<!--#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -