📄 administrator.asp
字号:
<%@language=vbscript%>
<!--#include file="../../inc/md5.asp"-->
<%dbdns="../../"%>
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../cook.asp"-->
<%if fla11<>1 then
response.write "<script>alert('操作权限出错,您没有权限操作些功能');history.go(-1);</Script>"
Response.End
end if%>
<%if request("action")="save" then
user=replace(trim(request("user")),"'","")
password=replace(trim(Request("pass")),"'","")
if user="" then
response.write "<script>alert('请输入登录用户名');history.go(-1);</Script>"
Response.End
elseif password="" then
response.write "<script>alert('请输入登录密码');history.go(-1);</Script>"
Response.End
end if
set rs=server.createobject("adodb.recordset")
sql="select * from SMT_admin where SMT_nick='"&user&"'"
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
response.write "<script>alert('此用户已存在,请重新输入');history.go(-1);</Script>"
Response.End
else
rs.addnew
rs("SMT_password")=md5(password)
rs("SMT_nick")=user
rs("SMT_flag")="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
rs.update
end if
rs.close
set rs=nothing
response.redirect "administrator.asp?action=reh"
elseif request("action")="del" then
conn.execute("Delete From SMT_admin Where SMT_id="&request("id")&"")
response.redirect "administrator.asp?action=reh"
elseif request("action")="pass" then
set rs=server.createobject("adodb.recordset")
sql="select * from SMT_admin where SMT_id="&request("id")&""
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
rs("SMT_password")=md5("123")
rs.update
end if
rs.close
set rs=nothing
response.redirect "administrator.asp"
end if%>
<%=citycss%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body style="margin:10">
<table width="95%" height="0" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#cccccc">
<form name="form1" method="post" action="administrator.asp?action=save">
<tr bgcolor="#efefef">
<td height="30" colspan=2> <strong>添加管理员::</strong></td>
</tr>
<tr bgcolor="#ffffff">
<td width="18%" height="30" align="center">用 户 名</td>
<td width="82%">
<input name="user" type="text" size=20 style="width:150" maxlength="30"></td>
</tr>
<tr bgcolor="#ffffff">
<td width="18%" height="30" align="center">初始密码</td>
<td width="82%">
<input name="pass" type="password" size=20 style="width:150" maxlength="30"></td>
</tr>
<tr bgcolor="#ffffff" align="center">
<td height="30" colspan=2><input type="submit" name="Submit" value="添 加" class=input1></td>
</tr>
</form>
</table>
<br>
<table width="95%" height="0" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#cccccc">
<tr bgcolor="#efefef" align="center">
<td width="18%" height="30"><strong>用户名</strong></td>
<td width="51%"><strong>操 作</strong></td>
</tr>
<%set rs=server.createobject("adodb.recordset")
sql="select * from SMT_admin order by SMT_id desc"
rs.open sql,conn,1,1
do while not rs.eof%>
<tr bgcolor="#ffffff" align="center">
<td height="30"><%=rs("SMT_nick")%></td>
<td><input type="button" name="Submit" value="恢复密码为123" onClick="javascript:window.open('administrator.asp?action=pass&id=<%=rs("SMT_id")%>','_self')" class=input1>
<input type="button" name="Submit" value="删 除" onClick="javascript:window.open('administrator.asp?action=del&id=<%=rs("SMT_id")%>','_self')" class=input1></td>
</tr>
<%rs.movenext
loop
rs.close
set rs=nothing%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -