📄 admin_loginadd.asp
字号:
<!--#include file="../inc/conn.asp"-->
<!--#include file="../md5.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/css.css" rel="stylesheet" type="text/css">
<title>『驴友俱乐部』网站管理系统</title>
<style type="text/css">
<!--
body {
background-color: #efe8d7;
margin-left: 15px;
}
-->
</style>
</head>
<%
dim server_v1,server_v2
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))'本地路径
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))'服务器路径
if mid(server_v1,8,len(server_v2))<>server_v2 then
response.write "<br><br><center><table border=1 cellpadding=20 bordercolor=black bgcolor=#EEEEEE width=450>"
response.write "<tr><td style='font:9pt Verdana'>"
response.write "你提交的路径有误,禁止从站点外部提交数据请不要乱该参数!"
response.write "</td></tr></table></center>"
response.end
end if
%>
<%
dim G_admin1,G_adminpass1,G_adminpass2,G_adminpop
if Request.QueryString("add")="yes" then
G_admin1=Request("G_admin1")
G_adminpass1=Request("G_adminpass1")
G_adminpass2=Request("G_adminpass2")
G_adminpop=Request("G_adminpop")
If G_admin1="" Then
response.write "SORRY <br>"
response.write "<a href=""javascript:history.go(-1)"">用户名不能为空,请返回重输</a>"
response.end
end if
If G_adminpass1<>G_adminpass2 Then
response.write "SORRY <br>"
response.write "<a href=""javascript:history.go(-1)"">您两次输入的密码不一致,请返回重输</a>"
response.end
end if
dim rstmp,rs,sql
set rstmp=conn.execute("Select * from G_admin Where G_admin='"&trim(request.form("G_admin1"))&"'")
if not rstmp.eof then
response.write "SORRY <br>"
response.write "你输入的用户名已经存在请重新输入,<a href=""javascript:history.go(-1)"">请返回重输</a>"
response.end
response.end
else
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from G_admin"
rs.open sql,conn,1,3
rs.addnew
rs("G_admin")=G_admin1
rs("G_adminpass")=md5(G_adminpass1)
rs("G_adminpop")=G_adminpop
rs.update
rs.close
response.redirect "admin_loginadd.asp"
end if
end if%>
<%
dim del,delpro
If Request.QueryString("del")="yes" Then
id = Request.QueryString("id")
Set del = conn.execute("Delete From [G_admin] Where G_adminid="&id)
response.redirect "admin_loginadd.asp"
del.close
Set delpro = Nothing
End If%>
<body><div align="center">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=0 width="780" align=center borderColorLight=#c89f7b border=1>
<tr>
<td height="30" align="center"><font color="#FF0000">『驴友俱乐部』</font>网站管理员</td>
</tr>
<tr>
<td height="30" align="center"><table width="760" border="0" cellspacing="0" cellpadding="0">
<tr><form name="form1" method="post" action="admin_loginadd.asp?add=yes">
<td align="center">
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td width="50">用户:</td>
<td width="130"><input name="G_admin1" type="text" id="G_admin1" size="20"></td>
<td width="50">密码:</td>
<td width="130"><input name="G_adminpass1" type="password" id="G_adminpass1" size="20"></td>
<td width="50">验证:</td>
<td width="130"><input name="G_adminpass2" type="password" id="G_adminpass2" size="20"></td>
<td width="90"><input name="G_adminpop" type="hidden" id="G_adminpop" value="1"></td>
<td><input type="submit" name="Submit" value="增加管理员"></td>
</tr>
</table>
</td>
</form></tr>
</table></td>
</tr>
<tr>
<td align="center"><!--管理员列表开始--><%
dim row_count
set rs=server.CreateObject("adodb.recordset")
rs.Source="select * from [G_admin] order by G_adminid desc"
rs.open rs.Source,conn,1,1%>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<%row_count=1 %>
<tr align="center"><%if rs.eof and rs.bof then
response.write "暂时没有管理员!"
else
Do While Not rs.EOF%>
<td width="760" align="left"><table width="380" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="15" height="24" align="center"><img src="images/4.gif" width="5" height="5"></td>
<td width="50" height="24">用户:</td>
<td width="100"><%=rs("G_admin")%></td>
<td width="45">权限:</td>
<td width="100" align="center"><%=rs("G_adminpop")%></td>
<td width="35" height="24" align="center"><a href="admin_loginmod.asp?id=<%=rs("G_adminid")%>">修改</a></td>
<td width="35" height="24" align="center"><a href="admin_loginadd.asp?del=yes&id=<%=rs("G_adminid")%>" onclick="{if(confirm('真的要删除吗?')){return true;}return false;}" alt="删除该用户">删除</a></td>
</tr>
<tr bgcolor="#c89f7b">
<td height="1" colspan="7" align="center"><!--表格高度1象素,谗嘴猫QQ:29771424--></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="1" colspan="7" align="center"><!--表格高度1象素,谗嘴猫QQ:29771424--></td>
</tr>
</table></td>
<% if row_count mod 2 =0 then%>
</tr><%end if
rs.MoveNext
row_count=row_count+1
Loop
rs.close
end if%>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="24"> </td>
</tr>
</table><!--管理员列表结束--></td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -