📄 ad_admin.asp
字号:
<!--#include file="conn.asp"-->
<%
if session("admin_name")="" then
response.redirect "ad_login.asp"
end if
%>
<!-- #include file="MD5.asp" -->
<%
set rs2=server.createobject("adodb.recordset")
sql2="select count(*) from admin where admin_name='"&request("admin_name1")&"'"
rs2.open sql2,conn,3,3
if rs2(0)<>0 then
response.write "Error:The administrator had existed!"
end if
if request("types")="addname" then
response.redirect "ad.asp"
end if
rs2.close
set rs2=nothing
%>
<%
if request("types")="mod" then
response.redirect "ad.asp"
end if
%>
<%
if request("types")="del" then
response.redirect "ad.asp"
end if
%>
<html>
<head>
</head>
<body bgcolor="#FFFFFF" text="#000000" background="blue.gif">
<% set rs=server.createobject("adodb.recordset")
sql="select count(*) from admin"
rs.open sql,conn,3,3
if rs(0)=0 then
response.write "<center>No administrator,please add"
rs.close
set rs=nothing
%>
<p align="center"><font style="font-size: 9pt; font-weight: 700">Add an administrator</font></p>
<form action="ad_admin.asp" method=post>
<table wadmin_idth="242" border="1">
<tr>
<td wadmin_idth="71"><span style="font-size: 9pt">Admin:</span></td>
<td wadmin_idth="155">
<input type="text" name="admin_name1" size="20">
</td>
</tr>
<tr>
<td wadmin_idth="71"><span style="font-size: 9pt">Password:</span></td>
<td wadmin_idth="155" align="center">
<input type="password" name="admin_pass1" size="20">
</td>
</tr>
</table>
<p>
<input type="submit" name="addname" value="Add">
<input type=hidden name="types" value="addname">
</p>
</form>
<% else %>
<div align="center">
<p><font style="font-size: 9pt; font-weight: 700">Add an administrator</font></p>
<form action="ad_admin.asp" method=post>
<table wadmin_idth="242" border="1">
<tr>
<td wadmin_idth="71"><span style="font-size: 9pt">Admin:</span></td>
<td wadmin_idth="155">
<input type="text" name="admin_name1" size="20">
</td>
</tr>
<tr>
<td wadmin_idth="71"><span style="font-size: 9pt">Password:</span></td>
<td wadmin_idth="155">
<input type="password" name="admin_pass1" size="20">
</td>
</tr>
</table>
<p>
<input type="submit" name="addname" value="Add">
<input type=hidden name="types" value="addname">
</p>
</form>
<% set rs3=server.createobject("adodb.recordset")
sql3="select * from admin"
rs3.open sql3,conn,3,3
%>
<%rs3.movefirst
for i=1 to rs3.recordcount
%>
<div align="center">
<form method=post action="ad_admin.asp">
<table wadmin_idth="400" border="1">
<tr>
<td wadmin_idth="50"><%=trim(rs3("admin_id"))%> </td>
<td wadmin_idth="140">
<input type="text" name="admin_name" value="<%=trim(rs3("admin_name"))%>" size="10">
</td>
<td wadmin_idth="140">
<input type="password" name="admin_pass" size="10">
</td>
<form method=post>
<td wadmin_idth="59">
<input type="submit" name="modify" value="Modify">
<input type="hidden" name="admin_id" value="<%=rs3("admin_id")%>">
<input type="hidden" name="types" value="mod">
</td>
</form>
<form method=post>
<td wadmin_idth="57">
<input type="submit" name="del" value="Delete">
<input type="hidden" name="admin_id" value="<%=rs3("admin_id")%>">
<input type="hidden" name="types" value="del"><span style="font-size: 9pt"></span>
</td>
</form>
</tr>
</table>
</form>
<%
rs3.movenext
next
rs3.close
set rs3=nothing
end if
conn.close
set conn=nothing
%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -