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

📄 change_password.asp

📁 实验室资源管理系统 实验室人事资料管理、实验室设备管理、实验课程管理及实验室软件资料管理及相关分析统计功能
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="include/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<LINK href="css/css.css" type="text/css" rel="stylesheet">
<script language="JavaScript">
function CheckForm()
{
	if(document.form.password.value=="")
	{
		alert("请输入原密码!");
		document.form.password.focus();
		return false;
	}
	if(document.form.password3.value == "")
	{
		alert("请输入新密码!");
		document.form.password3.focus();
		return false;
	}
	if(document.form.password4.value == "")
	{
		alert("请确认新密码!");
		document.form.password4.focus();
		return false;
	}
	if(document.form.password3.value <> document.form.password4.value)
	{
		alert("两次密码不一样,请重新输入!");
		document.form.password3.focus();
		return false;
	}
	
}
</script>
</head>



<body>

   <!--#include file="include/header.asp"-->
<table width="760" height="77" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>位置:管理系统:<a href="change_password.asp">修改密码</a></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="760" height="166" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="206">&nbsp;</td>
    <td width="574" valign="top">
	
	<form name="form" action="change_password.asp" method="post" target="_parent" onSubmit="return CheckForm();">
	<table width="400" border="0" cellpadding="0" cellspacing="1" bgcolor="#6fb86c">
      <tr>
        <td height="40" colspan="2" align="center" valign="middle" bgcolor="#f2fcf1">用户修改密码</td>
        </tr>
      <tr bgcolor="#fafafa">
        <td width="102">登录名:
          <label></label></td>
        <td width="295"><input type="text" name="username" value="<%=session("LoginName")%>" readonly/></td>
      </tr>
      <tr bgcolor="#fafafa">
        <td>原密码:          </td>
        <td><input type="text" name="password" /></td>
      </tr>
      <tr bgcolor="#fafafa">
        <td>新密码:
          <label></label></td>
        <td><input type="text" name="password3" /></td>
      </tr>
      <tr bgcolor="#fafafa">
        <td>确认新密码:          </td>
        <td><input type="text" name="password4" /></td>
      </tr>
      <tr bgcolor="#fafafa">
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>

      <tr bgcolor="#fafafa">
        <td colspan="2"><label>
          <div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="submit" name="Submit" value="修改" /> &nbsp;&nbsp;
            <input type="reset" name="Submit2" value="重置" />
			<input type="hidden" name="action" value="adduser">
            </div>
        </label></td>
        </tr>
    </table>
	</form>
	</td>
  </tr>
</table>
<%
if request("action")="adduser" then

	dim SQL,rs
	Set rs=Server.CreateObject("ADODB.RecordSet")
	SQL="Select * from student "
	rs.Open SQL,Conn,3,2

	if Request("password")="" then
	    Response.write "<script>alert('请填写旧密码!');window.open('change_password.asp','_self','');</script>"

	elseif Request("password")=rs("PassWord") then
	   
	 if Request("password3")="" then
	  Response.write "<script>alert('请填写新密码!');window.open('change_password.asp','_self','');</script>"
	  elseif  Request("password3")<>Request("password4") then
			Response.write "<script>alert('新密码填写不正确,请重新确认密码!');window.open('change_password.asp','_self','');</script>"
		  else
	   rs("Password")=trim(Request("password3"))
		  end if
	   rs.Update
	   	      
	else
		Response.write "<script>alert('旧密码不正确,请退出!');window.open('quitout.asp','_top','');</script>"

    end if

 rs.Close
 Conn.Close
 set Conn=nothing
 set rs=nothing
Response.write"<script>alert('你已经成功的修改了密码!');document.location='change_password.asp';</script>"
   
	
end if


%>
   <!--#include file="include/bottom.asp"-->
</body>
</html>

⌨️ 快捷键说明

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