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

📄 changepwd.asp

📁 使用Asp+Access+FSO+Jmail+Servu开发
💻 ASP
字号:
<!--#include file="chkuser.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="inc/conn.asp"-->
<%
if request("action")="ok" then
username=Request.Cookies("username")
oldpwd=md5(request.form("oldpwd"))
pwd2 = request.form("pwd2")
sql="select * from [user] where username='"&username&"' and password='"&oldpwd&"'"
rs.open sql,conn,1,3
if rs.bof or rs.eof then
response.redirect("error.asp?error=oldpass")
response.end
else
rs("password")= md5(pwd2)
rs.update
rs.close
Response.Write "<script>alert('密码更改成功\n\n您的新密码为:"&pwd2&"');location.href='changepwd.asp'</script>"
end if
end if
%>
<html>
<head>
<title>更改密码</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">
<script language="jscript">
<!--
function check_input()  
{  
	if (form1.oldpwd.value ==0){
		alert ("请输入旧密码");
		form1.oldpwd.focus();
		return false;
	}
	if (form1.pwd.value ==0){
		alert ("对不起,新密码密码不能为空!");
		form1.pwd.focus();
		return false;
	}
	if (form1.pwd.value.length < 6 || form1.pwd.value.length > 12){
		alert ("对不起,新的密码密码应该为6-12位");
		form1.pwd.focus();
		return false;
	}
	if (form1.pwd2.value ==0){
		alert ("请再次确认您的密码");
		form1.pwd2.focus();
		return false;
	}
	if (document.form1.pwd.value != document.form1.pwd2.value){
		alert ("您的两次输入的密码不一致");
		document.form1.pwd.focus();
		return false;
	}
    return true;
}
//-->
</script>
</head>
<body bgcolor="#F6ECE2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="70%">
  <tr> 
    <td align="center">
<fieldset style="padding: 2; width:200; height:120">
<legend><strong>更 改 密 码</strong></legend> 
<table width="300" border="0" align="center" cellpadding="5" cellspacing="1">
  <form name="form1" method="post" action="?action=ok" onsubmit="return check_input()">
    <tr> 
      <td width="81" align="center">旧 密 码: 
        </td>
      <td width="196"><input name="oldpwd" type="password" class="input" id="oldpwd2" size="18">
        * </td>
    </tr>
    <tr> 
      <td align="center">新 密 码:        </td>
      <td><input name="pwd" type="password" class="input" id="pwd" size="18">
*至少6位 </td>
    </tr>
    <tr> 
      <td align="center">重复密码:        </td>
      <td><input name="pwd2" type="password" class="input" id="pwd22" size="18">
        *确认密码</td>
    </tr>
    <tr> 
      <td colspan="2" align="center"> 
        <input type="submit" name="submit" value="确定" class="button"> 
        <input type="reset" name="submit2" value="取消" class="button">
      </td>
    </tr>
  </form>
</table> 
</fieldset></td>
  </tr>
</table>
</body></html>

⌨️ 快捷键说明

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