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

📄 user_pwd.asp

📁 大学的综合测评
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="const.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" />
<link href="img/Style.css" rel="stylesheet" type="text/css" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
-->
</style>
</head>
<body>

<%
action=Request("action")
user_no=Request.Cookies("zcas")("user_no")
ok=Session("ok")
if  not ok="ok" then 
Response.Write("<li>登录超时,请重新登录</li>")
Response.End()
end if

if action="update" then

		user_no=Request.form("user_no")
		user_pwd=md5(safeChar(Request("user_pwd")),32)
		 on error resume next		
			set c = Server.CreateObject("ADODB.Command")
			c.ActiveConnection = dbconn
			c.CommandText = "update pc_user set user_pwd='"&user_pwd&"' where user_no='"&user_no&"'"
			c.CommandType = 1
			c.CommandTimeout = 0
			c.Prepared = true
			c.Execute()
			if err.number="0" then
			Response.Write("<script language='javascript'>alert('修改成功,新密码:"&safeChar(Request("user_pwd"))&"');</script>")
			response.Write("<br /><br /><li>新密码:"&safeChar(Request("user_pwd"))&"</li>")
			else response.Write("<li>系统出错</li>")
			end if
       

%>

<%else
 Dim rs1
		Set rs1 = Server.CreateObject("ADODB.Recordset")
		rs1.ActiveConnection = dbconn
		rs1.Source = "SELECT user_no,user_name,user_pwd FROM pc_user where  user_no='"&user_no&"'"
		rs1.CursorType = 0
		rs1.CursorLocation = 2
		rs1.LockType = 1
		rs1.Open()
		if rs1.eof or rs1.bof then 
		response.Write("系统错误")
		response.End()
		end if

 %>
<script language="javascript">
function chk()
{
if(document.form.user_pwd.value=="") 
{alert('密码不能为空');return false;}
else 
return true;
}
</script>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<form name="form" action="" method="post" onsubmit="return chk()">
<table width="80%" border="0" align="center" cellpadding="1" cellspacing="0" class="atable1">
  <tr>
    <td colspan="6" bgcolor="#333" class="STYLE1"><span class="STYLE1">&nbsp;&nbsp;密码修改</span></td>
  </tr>
  <tr>
    <td width="13%" height="30" class="tdmenu">&nbsp;</td>
    <td width="13%" class="tdmenu">&nbsp;</td>
    <td width="13%" class="tdmenu">&nbsp;</td>
    <td width="17%" class="tdmenu">&nbsp;</td>
    <td width="14%" class="tdmenu">&nbsp;</td>
    <td width="30%" class="tdmenu">&nbsp;</td>
  </tr>
  <tr>
    <td class="tdmenu"><div align="center">学号:</div></td>
    <td class="tdmenu">     
       <%=rs1(0)%>
      </td>
    <td class="tdmenu"><div align="center">&nbsp;姓名:</div></td>
    <td class="tdmenu"><%=rs1(1)%></td>
    <td class="tdmenu"><div align="center">密码:</div></td>
    <td class="tdmenu">
      <div align="left">
        <input name="user_pwd" type="text" class="atable1" id="user_pwd" size="16" maxlength="16" />
        </div></td></tr>
  <tr>
    <td height="30" colspan="2" class="tdmenu">&nbsp;</td>
    <td height="30" class="tdmenu">&nbsp;</td>
    <td height="30" class="tdmenu">&nbsp;</td>
    <td class="tdmenu"><div align="center"><input name="提交" type="submit" class="tdmenu" id="提交" value="提交" />
    </div></td>
    <td class="tdmenu">
      <div align="left">
        <input name="重填" type="reset" class="tdmenu" id="重填" value="重填" />
        <input type="hidden" name="action" value="update" />
        <input name="user_no" type="hidden" id="user_no" value="<%=rs1(0)%>" />
      </div></td>
  </tr>
</table>
</form>
<%
rs1.close
set rs1=nothing
end if%>
</body>
</html>
<%dbconn.close%>

⌨️ 快捷键说明

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