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

📄 changepwd.asp

📁 这是ASP的OA
💻 ASP
字号:
<!-- #include file="const.asp" -->
<!-- #include file="convertpw.asp" -->
<%
call opendb()
checkuser()
position "更改用户密码",0
dim sql,rs,name,action1,oldpwd,password,repassword
name=trim1(request.Cookies("matrix3")("matrix3_name"))
action1=trim(request.Form("action1"))
if action1="DONE" then
	oldpwd=trim(request.Form("oldpwd"))
	password=trim(request.Form("password"))
	repassword=trim(request.Form("repassword"))
	if password<>repassword then
		call msg("两次输入的密码不一样!")
	end if
	if len(password)>16 then
		call msg("密码长度不能超过16位!")
	end if
	oldpwd=convertpw(oldpwd)
	password=convertpw(password)	
	sql="select * from m3_users where name='"&name&"'"
	set rs = Server.CreateObject("ADODB.Recordset")
	rs.open sql,conn,1,3
	if rs.eof and rs.bof then
		response.Redirect("error.asp?id=2")
		response.End()
	else
		if rs("password")<>oldpwd then
			rs.close
			set rs=nothing
			call closedb()
			response.Redirect("error.asp?id=5")
			response.End()
		else
			rs("password")=password
			rs.update
		end if
	end if
	rs.close
	set rs=nothing
	response.write("<script>alert('密码修改成功!');history.go(-2);</script>")
	response.End()
else
%>
<html>
<head>
<title><%=sitename%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="10" align="center" valign="top"><!-- #include file="topbar.asp" --></td>
  </tr>
  <tr> 
    <td align="center" valign="top"><table width="100%" height="60%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="10" align="center" valign="top" bgcolor="#ECE9D9"> </td>
          <td width="1" bgcolor="#E8BC3C"></td>
          <td width="10">&nbsp;</td>
          <td align="center" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="3">
              <tr> 
                <td width="100%" height="30" class=v8b><img src="images/btn_face.gif" width="10" height="7"> 
                  <b><font color="#000000">用户管理</font><font color="#990000"> &gt; 
                  <font color="#FF0000">更改密码</font></font></b></td>
              </tr>
              <tr> 
                <td height="1" bgcolor="#ECE9D9"></td>
              </tr>
            </table>
            <br> <table width="96%" border="0" cellpadding="2" cellspacing="1" bgcolor="#E8BC3C">
              <tr background="images/bg4.gif"> 
                <td width="50%" background="images/bg4.gif">&nbsp;</td>
              </tr>
              <tr> 
                <td align="center" valign="top" bgcolor="#FFFFFF"> <br> <form action="" method="post" name="mform" onSubmit="javascript:chkField();return false;">
                    <table width="471" border="0" cellpadding="4" cellspacing="1" bgcolor="#E8E4D0">
                      <tr> 
                        <td bgcolor="#D9D3B4" colspan="2" height="1"></td>
                      </tr>
                      <tr align="center"> 
                        <td height="50" colspan="2" bgcolor="#FFFFFF"><b><font color="#990000">更改密码</font></b></td>
                      </tr>
                      <tr> 
                        <td width="177" align="right" bgcolor="#FFFFFF" class=v8b>旧密码</td>
                        <td width="274" bgcolor="#FFFFFF"> <input name="oldpwd" type="password" class="input1" id="oldpwd" size="16" maxlength="16"> 
                        </td>
                      </tr>
                      <tr> 
                        <td align="right" bgcolor="#FFFFFF" class=v8b>新密码</td>
                        <td bgcolor="#FFFFFF"> <input name="password" type="password" id="password" class="input1" size="16" maxlength="16"> 
                        </td>
                      </tr>
                      <tr> 
                        <td align="right" bgcolor="#FFFFFF" class=v8b> 重输新密码</td>
                        <td bgcolor="#FFFFFF"> <input name="repassword" type="password" class="input1" id="repassword" size="16" maxlength="16"> 
                        </td>
                      </tr>
                      <tr> 
                        <td width="177" bgcolor="#FFFFFF">&nbsp;</td>
                        <td width="274" height="60" bgcolor="#FFFFFF"> <input name="action1" type="hidden" id="action1" value="DONE"> 
                          <input name="Submit1" type="submit" class="input" id="Submit1" value="更改"> 
                          <input name="cancel" type="button" id="cancel2" value="取消" class="input" onclick="history.go(-1)"> 
                        </td>
                      </tr>
                      <tr> 
                        <td colspan="2" bgcolor="#D9D3B4" height="1"></td>
                      </tr>
                      <tr> 
                        <td height="10" colspan="2" bgcolor="#FFFFFF"></td>
                      </tr>
                    </table>
                    <br>
                    <SCRIPT language=JavaScript>
function chkField()
{
		if (document.mform.oldpwd.value=="")
        {
            alert ('Invalid old password ! ');
            document.mform.password.focus();
            return false;
        }
        if (document.mform.password.value.length <6)
        {
            alert ('Invalid password ! (no less than 6 characters)');
            document.mform.password.focus();
            return false;
        }
		if (document.mform.repassword.value!=document.mform.password.value)
        {
            alert ('Password must match exactly.');
            document.mform.repassword.focus();
            return false;
        }
       document.mform.submit();
	   document.mform.Submit1.disabled=true;
}
</script>
                  </form>
                  <br> </td>
              </tr>
            </table>
            <br> </td>
          <td width="10">&nbsp;</td>
          <td width="1" bgcolor="#E8BC3C"></td>
          <td width="100" bgcolor="#ECE9D9" valign="top"> 
            <!-- #include file="right.asp" -->
          </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="10" align="center" valign="bottom"> 
      <!-- #include file="bottombar.asp" -->
    </td>
  </tr>
</table>
</body>
</html>
<%
end if
call closedb()
%>

⌨️ 快捷键说明

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