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

📄 chgpwd.asp

📁 商务网站,信息分类,可以搜索加上ACCESS数据库
💻 ASP
字号:
<%Option Explicit%>
<!--#include file="adoconn.asp"-->
<%'更改管理员密码%>

<head>
<title>管理员更改密码</title>
</head>
<body topmargin="50" leftmargin="50" bgcolor="#FFFFFF">
<%
dim objRS,sql
dim oldname,oldpass,newname,newpass1,newpass2
dim chgSuccess

if Request.ServerVariables("REQUEST_METHOD") = "POST" then
    oldname = request.form("oldname")
    oldpass = request.form("oldpass")
    newname = request.form("newname")
    newpass1 = request.form("newpass1")
    newpass2 = request.form("newpass2")
    
    chgSuccess = FALSE
    if Trim(oldname) = "" or Trim(oldpass) = "" or Trim(newname) = "" or Trim(newpass1) = "" or Trim(newpass2) = "" then
        response.write("<font color=red>帐号和密码不能为空!</font><br>")
    else
        if newpass1 <> newpass2 then
            response.write("<font color=red>两次输入的密码不相同!</font><br>")
        else
            Set objRS = Server.CreateObject("ADODB.RecordSet")
            sql = "password"
            objRS.Open sql,objConn,3,3
            if oldname = objRS("name") and oldpass = objRS("pwd") then
                if not objRS.eof then
                    objRS.MoveFirst
                    objRS("name") = newname
                    objRS("pwd") = newpass1
                    objRS.Update
                end if
                chgSuccess = TRUE
            else
                response.write("<font color=red>旧帐号或旧密码错误!</font><br>")
                objRS.Close
                Set objRS = nothing
            end if
        end if
    end if
    if chgSuccess then
        response.write("<center><font style={font-size:10.5pt;color:red> 成功修改密码!</font><br>")
        response.write("<font  style={font-size:10.5pt}>[<a href=""JavaScript: window.close()"" style={text-decoration:none;color:blue}>关闭窗口</a>]</font>")
        objRS.Close
        Set objRS = nothing
        objConn.Close
        Set objConn = nothing
        response.end        
    end if
end if
%> 
<form action="chgpwd.asp" method="POST">
    旧  帐  号:<input type="text" name="oldname" maxLength="16">旧&nbsp;&nbsp;密&nbsp;&nbsp;码:<input type="password" name="oldpass" maxLength="16"><br>
    新  帐  号:<input type="text" name="newname" maxLength="16"><br>
    新  密  码:<input type="password" name="newpass1" maxLength="16">确认新密码:<input type="password" name="newpass2" maxLength="16"><br>
    <input type="submit" value=" 更改密码 "><input type="reset" value=" 重  填 ">
</form>
<p align="right">
<font  style={font-size:10.5pt}>[<a href="JavaScript: window.close()" style={text-decoration:none;color:blue}>关闭窗口</a>]</font>

⌨️ 快捷键说明

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