📄 admin_users.asp
字号:
<% Option explicit %>
<!-- #Include file="./connects.inc"-->
<!-- #Include file="../globals.inc"-->
<html>
<head>
<title></title>
<link href="style/style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Page-Enter" content="blendTrans(Duration=1.0)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=1.0)">
<SCRIPT LANGUAGE=JavaScript>
<!--
function reset_or_not()
{ return confirm("真的要擦除重写吗?"); }
function check()
{
if (frmModiUser.newusername.value.length==0)
{alert("新的管理员 用户名 不能为空!");
frmModiUser.newusername.focus();
return false; }
if (frmModiUser.newpassword.value.length==0)
{alert("新的管理员 用户口令 不能为空!");
frmModiUser.newpassword.focus();
return false; }
}
//-->
</SCRIPT>
</head>
<%
Dim sSQL, rs, rs1, rs2, oldusername, oldpassword, newusername, newpassword, remark, autoid
sSQL = "select * from tabUserInfo " 'where usertype=administrator
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sSQL, sConn, 1, 1
if rs.eof and rs.bof then
response.write("<center>没有本用户的相关记录。</center>")
response.end
End if
%>
<body topmargin=30 leftmargin=0 background=../images/bg.gif>
<Form name="frmModiUser" method=post action="adminuser.asp" OnSubmit="return check();" onReset="return reset_or_not();">
<input name=istoModi type=hidden value="YES">
<input name=autoid type=hidden value=<%=rs("f_i_autoid")%>>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="28%" align="center" height="20">【旧用户名】</td>
<td width="72%" align="left" height="20"><input name=oldusername type=text size=25 maxlength=12></td>
</tr>
<tr>
<td width="28%" align="center" height="20">【旧 口 令】</td>
<td width="72%" align="left" height="20"><input name=oldpassword type=password size=25></td>
</tr>
<tr>
<td width="28%" align="center" height="20">【新用户名】</td>
<td width="72%" align="left" height="20"><input name=newusername type=text size=25 maxlength=12></td>
</tr>
<tr>
<td width="28%" align="center" height="20">【新 口 令】</td>
<td width="72%" align="left" height="20"><input name=newpassword type=password size=25 maxlength=12></td>
</tr>
<tr>
<td width="28%" align="center" height="20">【备 注】</td>
<td width="72%" align="left" height="20"><input name=remark type=text size=25 maxlength=50></td>
</tr>
<tr>
<td width="100%" colspan="2" align="center" height="25">
<input type=submit value="更 新"> <input type=reset value="重 置"></td>
</tr>
</table><br>
<script language=javascript>
//写“备注”数据
frmModiUser.remark.value='<%=trim(rs("f_remark"))%>'
</script>
<%
if NOT request("istoModi")="YES" then response.end
autoid=trim(request("autoid"))
oldusername=trim(request("oldusername"))
oldpassword=trim(request("oldpassword"))
newusername=trim(request("newusername"))
newpassword=trim(request("newpassword"))
remark=trim(request("remark"))
sSQL = "select top 1 * from users where usertype='administrator'"
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.open sSQL, S_conn_admin, 1, 1
if oldusername<>trim(rs2("username")) or oldpassword<>trim(rs2("password")) then
response.write "<center><font color=red>旧用户名或旧密码输入错误,请重新输入。</font></center>"
response.end
end if
rs.close
set rs=nothing
sSQL="update users set username='" & newusername & "', [password]='" & newpassword & "', remark='" & remark &"' where autoid=" & autoid &""
'response.write sSQL
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.open sSQL, S_conn_admin, 1, 3
response.write "<center><font color=blue>已经更新管理员用户信息。</font></center>"
set rs1=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -