?? administer.asp
字號:
<%@ language=VBScript %>
<!--#include file="setup.asp"-->
<%
if Request.cookies("admin") = "" or Request.cookies("admin") <> passwords then
message="對不起,非法登陸!\n"
call error(""&message&"")
Response.end
end if
if Request("menu") = "setup" then
call setup()
else call index()
end if
sub index()
%>
<html>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=gbook_name%></title>
<link rel="stylesheet" href="style.css">
</head>
<body bgcolor="#C8C8C8">
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="500">
<tr>
<td width="100%" bgcolor="#EFEFEF">
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" align="center" background="images/table.gif"><b><font color=ffffff><%=gbook_name%></font></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF">
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="75%" class="shadow">當前位置:<a href=<%=url%>><%=name%></a> - <a href=index.asp?userid=<%=userid%>>留言首頁</a> - 管理設置</td>
<td width="25%" class="shadow" align="right">進入時間:<%=time%></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<table cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%" height="3">
<tr>
<td width="100%"></td>
</tr>
</table>
<div align="center">
<center>
<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="500">
<form name="form" method="post" action="administer.asp?userid=<%=userid%>">
<input type=hidden name=menu value=setup>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">留言本名稱</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" name="gbook_name" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" value="<%=gbook_name%>"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">管理員密碼</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="password" size="20" name="password" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" value="<%=passwords%>"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">主頁的名稱</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" name="name" style="width: 200; height: 18" value="<%=name%>" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">網站的地址</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" name="url" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" value="<%=url%>"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">長度的限制</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" name="bodymax" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" value="<%=bodymax%>"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">每頁留言數</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" name="pagesize" style="width: 200; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" value="<%=pagesize%>"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">你的IP地址</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" style="width: 200; height: 18" value="<%=Request.ServerVariables("REMOTE_ADDR")%>" disabled="true"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">上次IP地址</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" style="width: 200; height: 18" value="<%=setup_ip%>" disabled="true"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">最后修改在</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="text" size="20" style="width: 200; height: 18" value="<%=setup_time%>" disabled="true"></td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">特殊用戶名</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<%
sql="select * from retain where userid='"&userid&"'"
set nrs = Server.CreateObject("ADODB.Recordset")
nrs.open sql,conn,1,1
do while not nrs.eof
retain_name = retain_name & nrs("retain_name") & "|"
nrs.movenext
loop
nrs.close
set nrs = nothing
%>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="50%">
<input type="text" size="20" style="width: 200; height: 18" value="<%=retain_name%>" disabled="true" name="1"></td>
<td width="25%" align="center">[<a href="retain.asp?userid=<%=userid%>">添加</a>]</td>
<td width="25%" align="center">[<a href="delretain.asp?userid=<%=userid%>">刪除</a>]</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">站長公告欄<br>
<a href="news.asp?userid=<%=userid%>">添加新公告</a></td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<%
sql="select * from news where userid="&userid&" order by id desc"
set srs = Server.CreateObject("ADODB.Recordset")
srs.open sql,conn,1,1
do while not srs.eof
%>
<tr>
<td width="50%">
<input type="text" size="20" style="width: 200; height: 18" value="<%=srs("news")%>" disabled="true" name="1"></td>
<td width="25%" align="center">[<a href="modnews.asp?id=<%=srs("id")%>&oldnews=<%=srs("news")%>&userid=<%=userid%>">修改</a>]</td>
<td width="25%" align="center">[<a href="delnews.asp?id=<%=srs("id")%>&userid=<%=userid%>">刪除</a>]</td>
</tr>
<%
srs.movenext
loop
srs.close
set srs = nothing
%>
</table>
</td>
</tr>
<tr>
<td width="25%" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#4F4F4F" width="100%">
<tr>
<td width="100%" class="shadow" align="center">請點擊確定</td>
</tr>
</table>
</td>
<td width="75%" bgcolor="#FFFFFF">
<input type="submit" value="確定" name="ok" style="width: 50; height: 18" onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''"></td>
</tr>
</form>
</table>
</center>
</div>
<%
call htmlend()
Response.End
end sub
sub setup()
gbook_name=Server.htmlencode(Request.form("gbook_name"))
password=Request.form("password")
name=Server.htmlencode(Request.form("name"))
url=Request.form("url")
bodymax=Request.form("bodymax")
pagesize=Request.form("pagesize")
setup_ip=Request.ServerVariables("REMOTE_ADDR")
if gbook_name = "" then
message="留言本名稱不能為空!\n"
end if
if password = "" then
message=message&"管理員口令不能為空!\n"
end if
if name = "" then
message=message&"您的網站名稱必須填寫!\n"
end if
if url = "" then
message=message&"您的網站地址必須填寫!\n"
end if
if bodymax = "" then
message=message&"您不能把留言內容大小限制設置為空!\n"
end if
if pagesize = "" then
message=message&"每頁顯示的留言數必須填寫!\n"
end if
if message<> "" then
call error(""&message&"")
Response.end
end if
sql = "select * from admin where id="&userid
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open sql,conn,3,3
Rs("gbook_name")=gbook_name
Rs("password")=password
Rs("name")=name
Rs("url")=url
Rs("bodymax")=bodymax
Rs("pagesize")=pagesize
Rs("setup_ip")=setup_ip
Rs("setup_time")=now
Rs.update
Rs.close
set Rs = nothing
conn.close
set conn = nothing
Response.redirect "administer.asp?userid="&userid
Response.End
end sub
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -