📄 admin.asp
字号:
<!--#include file="config.asp"-->
<%'##检查cookies中的密码,错误侧自东返回
set rsadm=server.createobject("adodb.recordset")
sqladm="select * from admin"
rsadm.open sqladm,conn,1,1
if request.cookies("adminok")<>rsadm("pwd") or request.cookies("adminok")="" or request.cookies("user")<>rsadm("user") or request.cookies("user")="" then
response.redirect "admlogin.asp"
end if
'###检查结束
%>
<html>
<head>
<title>超级管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
dim MaxPerPage
dim sql
dim rs
dim gstBookID
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
if request("se")="" then
se=request.form("se")
else
se=request("se")
end if
if not isEmpty(request("pl")) then
pl=request("pl")
else
pl="id"
end if
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body topmargin="0" background="pic/a1bf.gif">
<%
set rs=server.createobject("adodb.recordset")
if request.form("se")="" and request("se")="" then
sql="select * from user order by id desc"
else
sql="select * from user where "&pl&" like '%"&se&"%' order by id desc"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then %>
<p align="center">没有或没找到任何记录!</p>
<% else
rs.pagesize=10
totalPut=rs.recordcount '记录总数
totalPage=rs.pagecount
MaxPerPage=rs.pagesize
if currentpage<1 then
currentpage=1
end if
if currentpage>totalPage then
currentpage=totalPage
end if
if currentPage=1 then
showpages
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark '移动到开始显示的记录位置
showpages
showContent
showpages
end if
end if
end if
sub showContent
dim i
dim k
k=(totalPut-MaxPerPage*(currentPage-1))+1
i=0
%>
<table style="FILTER: alpha(opacity=65)" border="0" width="100%" cellspacing="1" cellpadding="3" bgcolor="#d2e8b5">
<tr bgcolor="#FFFFFF">
<td width="4%">
<p align="center">ID</p>
</td>
<td width="10%" bgcolor="#FFFFFF" background="pic/a1bf.gif">删除用户</td>
<td width="8%" bgcolor="#FFFFFF" background="pic/a1bf.gif">留言数量</td>
<td width="12%" bgcolor="#FFFFFF" background="pic/a1bf.gif">用户名</td>
<td width="10%" bgcolor="#FFFFFF" background="pic/a1bf.gif">密码</td>
<td width="25%" bgcolor="#FFFFFF" background="pic/a1bf.gif">EMAIL</td>
<td width="28%" bgcolor="#FFFFFF" background="pic/a1bf.gif">主页</td>
<td width="8%" bgcolor="#FFFFFF" background="pic/a1bf.gif">用户资料</td>
</tr>
<%do while not (rs.eof or err)
k=k-1
%>
<form method="post" action="login.asp?user=<%=rs("user")%>" target="_blank">
<input class=stedit type="hidden" name=user value="<%=rs("user")%>">
<input class=stedit type="hidden" name=pwd value="<%=rs("pwd")%>">
<tr bgcolor="#FFFFFF">
<td width="4%" nowrap>
<p align="center"><%=rs("id")%></td>
<td width="10%" nowrap bgcolor="#FFFFFF" background="pic/a1bf.gif"><a href='admdel.asp?id=<%=rs("id")%>' onclick="window.open("admdel.asp?d=yes&id=<%=rs("id")%>&user=<%=rs("user")%>&page=<%=Request("page")%>","","width=200,height=100,status=yes,scrollbars=yes,resizable=yes")" target="_blank">删除此用户</a></td>
<td width="8%" nowrap bgcolor="#FFFFFF" background="pic/a1bf.gif"><font color="#FF0000">
<%set rsdata=server.createobject("adodb.recordset")
sqldata="select * from book where user='"&rs("user")&"' order by id desc"
rsdata.open sqldata,conn,1,1
response.write"<b>"&rsdata.recordcount&"</b>"%>
</font>
<%if not rsdata.eof then%>
<br>
<%=rsdata("time")%><%end if%></td>
<td width="12%" nowrap bgcolor="#FFFFFF" background="pic/a1bf.gif"><a href="index.asp?user=<%=rs("user")%>" target="_blank"><%=rs("user")%></a></td>
<td width="10%" nowrap bgcolor="#FFFFFF" background="pic/a1bf.gif"><%=rs("pwd")%></td>
<td width="25%" nowrap bgcolor="#FFFFFF" background="pic/a1bf.gif"><a href="mailto:<%=rs("email")%>"><%=rs("email")%></a></td>
<td width="28%" nowrap bgcolor="#FFFFFF" background="pic/a1bf.gif"><a href="<%=rs("url")%>" target="_blank"><%=rs("url")%></a></td>
<td width="8%" bgcolor="#FFFFFF" background="pic/a1bf.gif">
<input class=button type="submit" value="查看" name="B3"></td>
</tr>
</form>
<%
i=i+1
if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出
rs.movenext
loop
end sub
sub showpages()
dim n
n=totalPage
%>
</table>
<form Action="manage.asp" Method="GET" align="right">
<div align="center"><center>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="30">
<tr>
<td width="100%" height="30">
<p align="center"><%
If currentPage <> 1 Then
Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&">[第一页]</A> "
Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&"&Page=" & (currentPage-1) & ">[上一页]</A> "
End If
If currentPage <> rs.PageCount Then
Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&"&Page=" & (currentPage+1) & ">[下一页]</A> "
Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&"&Page=" & totalPage & ">[最后一页]</A> "
End If
%><%if se<>"" then%>查找<b><font color="#FF0000"><%=se%></font></b><%end if%> 共找到<font color="#FF0000"><%=totalPut%></font>条记录,第<%=currentPage%>页,共<%=totalPage%>页
条转到:第<Select name="go" onChange="window.location=form.go.options[form.go.selectedIndex].value" size="1" class=smallselsect style='BACKGROUND-COLOR:#ffffff;font-family: 宋体; font-size: 9pt;'>
<%for i=1 to n
response.write "<option value="&filename&"?pl="&pl&"&se="&se&"&page="& i
if currentpage=i then
response.write " selected"
end if
response.write ">"& i &"</option>"
next
response.write "</select>页"
%>
</select>
</td>
</tr>
</table>
</center></div>
</form>
<%
end sub
%>
<form name=pwd method="post" action="admsavepwd.asp">
<table style="FILTER: alpha(opacity=65)" border="0" width="100%" bgcolor="#d2e8b5" cellspacing="1" cellpadding="3">
<tr bgcolor="#FFFFFF" background="pic/a1bf.gif">
<td width="17%" align="center"><b>修改管理密码</b></td>
<td width="49%" align="center">用户名:
<input type="password" name="user" size="15" value="<%=rsadm("user")%>">密码:<input type="password" name="pwd" size="15" value="<%=rsadm("pwd")%>"></td>
<td width="34%" align="center">
<input class=button type="submit" value="修改" name="d"><input class=button type="reset" value="重写" name="B2"></td>
</tr>
</table>
</form>
<form name="searchtitle" method="POST" action="admin.asp">
<div align="center">
<center>
<table style="FILTER: alpha(opacity=65)" border="0" width="50%" cellspacing="1" cellpadding="3" bgcolor="#d2e8b5">
<tr>
<td width="100%" background="pic/a1bf.gif">
<p align="center"> 输入您要搜索的字符<br>
<input type="text" name="se" size="17">
<select name="pl" size="1">
<option value="user">用户</option>
<option value="email">信箱</option>
<option value="url">网址</option>
</select>
<input class=button type="submit" value="查询" name="title">
</td>
</tr>
</table></center>
</div>
</form> <center>
<font size="1">[<a href="javascript:history.go(-1)">返回上页</a>]</font>
<font size="1">[<a href="admlogin.asp">退出登陆</a>]</font>
</body>
</html>
<%rsadm.close
set rsadm=nothing
rs.close
set rs=nothing
conn.close
set conn=nothing %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -