⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminer.asp

📁 我的课程设计
💻 ASP
字号:
<%@ language=VBScript %>
<!--#include file="setup.asp"-->
<%

	if Request.cookies("admin") = "" 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><head><title><%=gbook_name%>--管理设置</title>
<link rel="stylesheet" href="../css/admin.css">
</head>
<body topmargin=0 >
<br>
<table width=600 height="27" border=1 bordercolor="#FFFFFF" align="center" cellpadding=0 cellspacing=1  style="border: 1px solid #CCCCCC;">
  <tr> 

    <td width="245"><div align="right">【<a href="index.asp">查看留言</a>】  【<a href="write.asp">签写留言</a>】</div></td>
  </tr>
</table>
<br>

<table width="600" border="0" align="center" cellspacing="0" cellpadding="0">
  <tr> 
    <td height="305" width="100%"> 
      <form name="FORM" method="POST" action="adminer.asp">
<input type=hidden name=menu value=setup>
        <table width="100%" border="0" cellspacing="1" cellpadding="4" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#999999">
          <tr bgcolor="#f7f7f7"> 
            <td width="19%" align="center" nowrap>留言本名称:</td>
            <td width="81%"> 
              <input type="text" name="gbook_name" size="20" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" value=<%=gbook_name%>>
            </td>
          </tr>
          <tr bgcolor="#f7f7f7"> 
            <td width="19%" align="center" nowrap>管理员口令:</td>
            <td width="81%"> 
              <input type="password" name="password" size="21" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" value=<%=passwords%>>
            </td>
          </tr>
          <tr bgcolor="#f7f7f7"> 
            <td width="19%" height="12" align="center" nowrap>网站名称:</td>
            <td width="81%" height="12"> 
              <input type="text" name="name" size="20" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" value=<%=name%>>
            </td>
          </tr>
          <tr bgcolor="#f7f7f7"> 
            <td width="19%" height="12" align="center" nowrap>网站地址:</td>
            <td width="81%" height="12"> 
              <input type="text" name="url" size="20" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" value=<%=url%>>
            </td>
          </tr>
          <tr bgcolor="#f7f7f7"> 
            <td width="19%" height="12" align="center" nowrap>留言内容大小限制:</td>
            <td width="81%" height="12"> 
              <input type="text" name="bodymax" size="6" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" value=<%=bodymax%>> 字节内
            </td>
          <tr bgcolor="#f7f7f7"> 
            <td width="19%" height="12" align="center" nowrap>每页显示的留言数:</td>
            <td width="81%" height="12"> 
              <input type="text" name="pagesize" size="4" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" value=<%=pagesize%>> (默认:10条)
            </td>
          </tr>
          <tr bgcolor="#f7f7f7"> 
            <td width="19%" height="12" align="center" nowrap>您的IP:</td>
            <td width="81%" height="12"> <%=Request.ServerVariables("REMOTE_ADDR")%> 
              (注意:提交后,您的IP会被记录!) </td>
          </tr>
          <tr bgcolor="#f7f7f7"> 
            <td width="19%" height="12" align="center" nowrap>上次提交IP:</td>
            <td width="81%" height="12"> <%=setup_ip%> </td>
          </tr>
          <tr bgcolor="#f7f7f7"> 
            <td width="19%" height="12" align="center" nowrap>上次提交时间:</td>
            <td width="81%" height="12"> <%=setup_time%> </td>
          </tr>
          <tr bgcolor="#f7f7f7"> 
            <td colspan="2" align="center" nowrap> 
              <input type="submit" name="Submit" value="提 交" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px">
              <input type="reset" name="Submit2" value="重 置" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px">
              <input type="button" name="Submit3" value="退 出" onClick="window.location.href='login.asp?menu=logout';" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px">
           </td>
          </tr>
        </table>
      </form>
    </td>
  </tr>
</table>

<%
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"
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 "adminer.asp"
Response.End

end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -