edit_password.asp

来自「倉庫管理繫統源碼,具有添加,查看,搜索,删除等功能」· ASP 代码 · 共 55 行

ASP
55
字号
<!--#include file="conn.inc"-->
<%if request("action")="modi" then
		call modi_password
end if%>
<html>
<head>
<title>更改用户密码</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body>
<form name="form1" method="post" action="edit_password.asp?action=modi">
  <table width="356" height="119" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000" class="12">
    <tr bgcolor="#FFFFFF"> 
      <td width="147" height="37"><div align="left"> 密码:<br>
           <font color="#FF0000">请输入您的新密码。</font></div></td>
      <td width="206"> <div align="left">  
<input name="password" type="password" class="txt" id="password">
        </div></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 密码(验证):<br>
         <font color="#FF0000">请再次输入您的新密码。</font></td>
      <td> <div align="left">  
<input name="repassword" type="password" class="txt" id="repassword">
        </div></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2"><div align="center">
          <input name="Submit" type="submit" class="button" value="更改密码">
        </div></td>
    </tr>
  </table>
</form>
<br>
</body>
</html>
<%sub modi_password
if request.form("password")=request.form("repassword") then
	'conn.execute("update user_info set password='"&trim(request.form("password"))&"' where id="&request.cookies("userid"))
	dim rs,sql
	set rs=server.createobject("adodb.recordset")
	sql="select * from user_info where id="&request.cookies("userid")
	rs.open sql,conn,1,3
	rs("password")=request.form("password")
	rs.update
	response.write("成功修改密码!")
	response.end
else%>
<script>
alert("您两次输入的密码不一致!");
</script>
<%end if
end sub%>

⌨️ 快捷键说明

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