📄 admin.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<!--#include file="top.asp"-->
<%
select case request("act")
case "check"
call check()
case "main"
call main()
case "logout"
call logout()
case "update"
call update()
case else
call login()
end select
sub login()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=urlname%> - 后台管理</title>
</head>
<body>
<%
if session("err")>=3 then
errinfo="程序限制了登陆次数,请稍后再登陆"
error(errinfo)
exit sub
end if
if session(Variable&Names)=Variable then
sucinfo="您已成功登陆管理,请进行相关操作<br><font color=#999999>(温馨提示:如果你在公共场所登陆帐号,请记点击退出)</font>"
suc(sucinfo)
exit sub
end if
%>
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="4%"><img src="images/skin/t-tl.gif" width="31" height="29"></td>
<td width="91%" background="images/skin/t-tc.gif"> </td>
<td width="5%"><img src="images/skin/t-tr.gif" width="35" height="29"></td>
</tr>
<tr>
<td background="images/skin/t-lt.gif"> </td>
<td>
<form action="?act=check" method="post">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="70%">
<tr>
<td width="50%" height="50%" align="center" valign="top">
<table width="480"border="1" align="center" cellspacing="0" cellpadding="3" bgcolor="#FFFFFF" bordercolor="#f0f0f0" style="border-collapse: collapse">
<tr>
<td width="70" align="center"><img src="images/admin.gif" title="登陆帐号"></td>
<td width="492"><input type="text" name="names" size="25"></td>
</tr>
<tr>
<td align="center"><img src="images/keywords.gif" title="验证密码"></td>
<td><input type="password" name="password" size="25"></td>
</tr>
<tr>
<td align="center">验 证 码</td>
<td><input name="adminid" type="text" size="5" maxlength="4">
<img src="code.asp"></td>
</tr>
<tr>
<td> </td>
<td><input name="submit" type="submit" value="确 定">
<input name="submit2" type="reset" value="重 置"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
<td background="images/skin/t-rt.gif"> </td>
</tr>
<tr>
<td><img src="images/skin/t-bl.gif" width="31" height="32"></td>
<td background="images/skin/t-bc.gif"></td>
<td><img src="images/skin/t-br.gif" width="35" height="32"></td>
</tr>
</table>
<%
end sub
sub check()
If Not ChkPost Then
errinfo="对不起,请不要从外部提交数据"
error(errinfo)
exit sub
End If
dim name,password,lasttime,adminid
name=trim(replace(request("names"),"'",""))
if Trim(Request.Form("password"))="" then
errinfo="『登陆密码』没有填写"
error(errinfo)
exit sub
else
password=md5(trim(replace(Request("password"),"'","")))
end if
adminid=request.Form("adminid")
lasttime=session("lasttime")
if lasttime+3/8640>=now() then
errinfo="操作太频繁,请稍后再登陆"
error(errinfo)
exit sub
end if
if session("adminid")<>adminid or not isnumeric(adminid) or adminid="" then
errinfo="验证码输入错误,请输入正确的验证码"
error(errinfo)
exit sub
end if
if session("err")>=3 then
errinfo="程序限制了登陆次数,请稍后再登陆"
error(errinfo)
exit sub
end if
session("lasttime")=now()
sql="Select * from admin where id=1"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if name=rs("name") and password=rs("password") then
session(Variable&Names)=Variable
session("err")=0
sucinfo="您已成功登陆管理,请进行相关操作<br><font color=#999999>(温馨提示:如果你在公共场所登陆帐号,请记点击退出)</font><p align=""center""><input type=""button"" onClick=""javascript:window.location.href='main.asp';"" value=""管理留言""> <input type=""button"" onClick=""javascript:window.location.href='?act=main';"" value=""后台管理"">"
suc(sucinfo)
exit sub
else
errinfo="名称或密码错误"
error(errinfo)
session("err")=session("err")+1
exit sub
end if
rs.close
set rs=nothing
end sub
sub main()
if not session(Variable&Names)=Variable then
errinfo="您没有登陆或已经退出登陆"
error(errinfo)
exit sub
end if
%>
<title><%=urlname%> - 后台管理</title>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="4%"><img src="images/skin/t-tl.gif" width="31" height="29"></td>
<td width="91%" background="images/skin/t-tc.gif"> </td>
<td width="5%"><img src="images/skin/t-tr.gif" width="35" height="29"></td>
</tr>
<tr>
<td background="images/skin/t-lt.gif"> </td>
<td> <form method="POST" action="?act=update">
<table width="90%" height="45%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#cad6eb" style="border-collapse: collapse">
<tr>
<td height="30" colspan="2" align="center" background="images/skin/t-tc.gif" bgcolor="#F4F6FC">留言本管理</td>
</tr>
<tr>
<td width="22%" height="30" align="center">留言本名称</td>
<td width="78%"> <input type="text" name="urlname" size="30" value="<%=urlname%>"></td>
</tr>
<tr>
<td width="22%" height="30" align="center">管理员名称</td>
<td> <input type="text" name="names" size="30" value="<%=names%>"></td>
</tr>
<tr>
<td width="22%" height="30" align="center">每页显示公告数</td>
<td> <input type="text" name="page" size="10" value="<%=page%>">
</td>
</tr><tr>
<td width="22%" height="30" align="center">每页显示留言数</td>
<td> <input type="text" name="perpage" size="10" value="<%=perpage%>">
</td>
</tr>
<tr>
<td width="22%" height="30" align="center">留言本状态</td>
<td> 开放 <input type="radio" value="0"<%If locks="0" Then%> checked <%End If%> name="locks"> 锁定 <input type="radio" name="locks" value="1"<%If locks="1" Then%> checked <%End If%>>
</td>
</tr>
<tr>
<td width="22%" height="30" align="center">数据库管理<br><font color="#999999">需要服务器FSO的支持</td>
<td><a href="data.asp?act=compact"> 压缩数据库</a> <a href="data.asp?act=bak">备份数据库</a> <a href="data.asp?act=restore">恢复数据库</a> <a href="data.asp?act=diskview">系统空间占用</a> <a href="list_file.asp">数据库备份管理</a></td>
</tr></table>
<p align="center"><input type="Submit" value="确 定" name="Submit"> <input type="reset" name="Submit2" value="重 置"></p>
</form></td>
<td background="images/skin/t-rt.gif"> </td>
</tr>
<tr>
<td><img src="images/skin/t-bl.gif" width="31" height="32"></td>
<td background="images/skin/t-bc.gif"></td>
<td><img src="images/skin/t-br.gif" width="35" height="32"></td>
</tr>
</table>
<%
conn.close
set rs=nothing
end sub
sub logout()
session("admin")="logout"
session(Variable&Names)=""
password=""
response.redirect "main.asp"
end sub
sub update()
If Not ChkPost Then
errinfo="对不起,请不要从外部提交数据"
error(errinfo)
exit sub
End If
dim urlname,names,page,perpage,locks,powerby
urlname=request.Form("urlname")
names=request.Form("names")
perpage=request.Form("perpage")
page=request.Form("page")
locks=request.Form("locks")
powerby="Powered By: 不想上网 <a href=http://hlcn.cn target=_blank>Version:R3.0</a>(2006.03.06)"
if urlname="" or names="" or perpage="" or page="" then
errinfo="请完整填写各项内容"
error(errinfo)
exit sub
elseif not(isnumeric(page)) or not(isnumeric(perpage)) then
errinfo="每页显示数必须是数字"
error(errinfo)
exit sub
end if
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from admin where id=1"
rs.open sql,conn,3,2
rs.update
rs("urlname")=urlname
rs("name")=names
rs("perpage")=perpage
rs("page")=page
rs("lock")=locks
rs("powerby")=powerby
rs.update
rs.close
sucinfo="修改成功"
suc(sucinfo)
end sub
%>
<!--#include file="bottom.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -