📄 adminuser_myedit.asp
字号:
<%@ Language=VBScript%>
<%
Response.Buffer=false
Response.Expires=0
if Session("userqx")="1" or Session("userqx")="9" then
username=Session("username")
if username="" then
Response.Redirect "../warn.asp"
end if
else
Response.Redirect "../warn.asp"
end if
htmlname="adminuser_myedit.asp"
%>
<!-- #include file="../dsn.asp" -->
<%
set cn = Server.CreateObject("ADODB.Connection")
cn.Open(mycnstr)
set rs = Server.CreateObject("ADODB.Recordset")
if Request.ServerVariables("REQUEST_METHOD")="POST" then
password=trim(Request.Form("password"))
sqltext="select * from adminuser where username='"+username+"'"
rs.Open sqltext,cn,3,3
if not rs.EOF then
rs("userpass")=password
realname=trim(rs("realname"))
rs.Update
errtxt="已更改成功!"
end if
rs.Close
else
sqltext="select * from adminuser where username='"+username+"'"
rs.Open sqltext,cn,1,1
if not rs.EOF then
realname=trim(rs("realname"))
password=trim(rs("userpass"))
password2=password
end if
rs.Close
end if
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {font-size: 12px; color: #000; font-family: 宋体}
td {font-size: 12px; color: #000; font-family: 宋体;line-height:130%}
.t1 {font:12px 宋体;color=000000}
.t2 {font:12px 宋体;color:ffffff}
.t3 {font:13px 宋体;color:000000}
.bt1 {font:12px 宋体;color=000000}
.bt2 {font:12px 宋体;color:ffffff}
.bt3 {font:16px 宋体;color:ff6600}
A:link {font-size:12px;text-decoration:underline;color:#000066;}
A:visited {font-size:12px;text-decoration:underline;color:#000066;}
A:hover {font-size:12px;text-decoration:underline;color:#cc0000;}
A.r1:link {font-size:12px;text-decoration:underline;color:#000066;}
A.r1:visited {font-size:12px;text-decoration:underline;color:#000066;}
A.r1:hover {font-size:12px;text-decoration:underline;color:#cc0000;}
A.r2:link {font-size:13px;text-decoration:none;color:#000000;}
A.r2:visited {font-size:13px;text-decoration:none;color:#000000;}
A.r2:hover {font-size:13px;text-decoration:none;color:#cc0000;}
A.r3:link {font-size:12px;text-decoration:none;color:#000000;}
A.r3:visited {font-size:12px;text-decoration:none;color:#000000;}
A.r3:hover {font-size:12px;text-decoration:underline;color:#cc0000;}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center>
<tr bgcolor=ffffff height=50>
<td> <font color=ff6600><b>修 改 密 码</b></font></td>
</tr>
</table>
<table width="96%" border="0" cellspacing="0" cellpadding="0" align=center>
<tr>
<td width=100%>
<form name=form1 method=post action="<%=htmlname%>" onsubmit="return checkform(form1)">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width=70 align=right></td>
<td colspan=3><font color=red><%=errtxt%></a></td>
</tr>
<tr>
<td width=70 align=right>您的名称:</td>
<td colspan=3><%=realname%></td>
</tr>
<tr>
<td width=70 align=right>新密码:</td>
<td colspan=3>
<input type=password name=password value="<%=password%>" size=20 maxlength=20><font color=red>*</font>
</td>
</tr>
<tr>
<td width=70 align=right>确认密码:</td>
<td colspan=3>
<input type=password name=password2 value="<%=password%>" size=20 maxlength=20><font color=red>*</font>
</td>
</tr>
<tr>
<td width=70></td>
<td colspan=3><br> <input type=submit name=submit value="确认提交"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
<script language=Javascript>
function checkform(form)
{
var flag=true;
if(form("password").value=="")
{alert("密码不能为空!");form("password").focus();return false;}
if(form("password2").value!=form("password").value)
{alert("两次密码不一致!");form("password").value="";form("password2").value="";form("password").focus();return false;}
if (flag==true) {flag=checkchar(form("password").value)}
return flag;
}
function checkchar(str)
{
str=str.toLowerCase()
if (str.search("<"+"%")>0)
{
window.alert("("+str+")中有非法字符,请检查!")
return false;
}
if (str.search("<scrip"+"t")>0)
{
window.alert("("+str+")中有非法字符,请检查!")
return false;
}
return true;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -