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

📄 changepass.asp

📁 电脑技术精华大全-共77册-507M.zip
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="newconn.asp"-->
<%
dim username
dim oldpwd
dim newpwd
dim compwd
dim sql
dim rs
dim errmsg
dim founderror
username=trim(request("name"))
oldpwd=trim(request("oldpwd"))
newpwd=trim(request("newpwd"))
compwd=trim(request("compwd"))
FoundError=false
if username="" then
   ErrMsg="请输入姓名"
   foundError=True
elseif oldpwd="" then
   ErrMsg="请输入旧密码"
   foundError=True
elseif newpwd="" then
   ErrMsg="请输入新密码"
   foundError=True
elseif compwd="" then
   ErrMsg="请输入确认密码"
   foundError=True
elseif newpwd<>compwd then
   ErrMsg="新密码与确认密码不相同"
   foundError=True

end if
if founderror then
    session("ErrMsg")=ErrMsg
    response.redirect "myinfo.asp?page=1"
else
   set rs=server.createobject("adodb.recordset")
   sql="select * from User"
   rs.open sql,conn,1,3
   if err.number<>0 then 
      response.write "数据库操作失败:"&err.description
   else
      dim FoundUser
      FoundUser=false
      do while  not (rs.eof or err.number<>0)
         if ucase(rs("UserName"))=ucase(UserName) and ucase(rs("userpassword"))=ucase(oldpwd) then
            FoundUser=True
 	        rs("userpassword")=newpwd
	        rs.update
	        Msg="密码修改成功,请记住你的密码"
	       exit do 
	     end if
	 rs.movenext
    loop
      if not FoundUser then
         Msg="您的名字不存在或您的密码不正确"
         founderror=true 
      end if
    rs.close
    end if
end if
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>更改密码</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<link rel="stylesheet" type="text/css" href="forum.css">
</head>

<body>

<p align="center"><%=msg%>  </p>
</body>
</html>

⌨️ 快捷键说明

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