manage.asp

来自「个人主页全站v2.0 个人主页全站v2.0 个人主页全站v2.0」· ASP 代码 · 共 310 行

ASP
310
字号
<!--#include file="config.asp"-->
<%
on error resume next

set rs = server.createobject("adodb.recordset")
sql = "select * from config"
rs.open sql,conn,1,1

if date <> idate then
rs("today") = 0
end if
rs("date") = date
rs.update

rs.close

iaction = request("action")

if iaction = "manage" then
iname = request.form("name")
ipass = request.form("password")
if iname = "" or ipass = "" then
ierror = "用户名或密码未填"
else
if iname = iadmin and ipass = ipassword then
response.cookies("iadmin") = "admin"
else
ierror = "用户名或密码错误"
end if
end if
end if
%>
<html>

<head>
<!--- The site is designed by Wind Song Studio --->
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="author" content="webmaster@i986.com">
<meta name="description" content="风雅颂工作室,Wind Song Studio.">
<meta name="keywords" content="风雅颂,工作室,设计,Studio,Wind,Song,Design">
<link href="style.css" rel="stylesheet" type="text/css">
<title><%=ititle%></title>
<base target="_blank">
</head>

<body bgcolor="#EEEEEE" topmargin="0" leftmargin="0">
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="800">
    <tr>
      <td width="100" background="images/main/left.gif"> </td>
      <td width="600" bgcolor="#cea772">
      <img border="0" src="images/main/top.jpg"></td>
      <td width="100" background="images/main/right.gif"> </td>
    </tr>
  </table>
  </center>
</div>

<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="800" height="100%">
    <tr>
      <td width="100" background="images/main/left.gif"> </td>
      <td width="600" bgcolor="#e4c59a" valign="top">
      <div align="center">
        <center>
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="580">
        <tr>
          <td width="5%" align="center">
          <img border="0" src="images/main/now.gif"></td>
          <td width="35%">
          <p style="margin-top: 2"><a href="<%=iurl%>"><%=ihomepage%></a><span style="font-size: 6pt">&gt;&gt;</span>管理 
          留言</td>
          <td width="20%" align="center">
          <a href="new.asp">
          <img border="0" src="images/main/new.jpg"></a></td>
          <td width="20%" align="center">
          <a href="index.asp">
          <img border="0" src="images/main/list.jpg"></a></td>
          <td width="20%" align="center">
          <a href="manage.asp">
          <img border="0" src="images/main/manage.jpg"></a></td>
        </tr>
      </table>
        </center>
      </div>
<%
if request.cookies("iadmin") <> "admin" then
%>
      <div align="center">
        <center>
      <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="590">
        <tr><td>
          <table border="0" cellpadding="2" cellspacing="1" style="border-collapse: collapse; border-style: solid; border-width: 1" bordercolor="#86540c" width="100%" id="AutoNumber1">
          <form name="imanage" method="post" action="manage.asp" target="_self">
            <tr>
              <td width="100%" colspan="2" bgcolor="#86540c" bordercolor="#e4c59a"><p align="center" style="margin-top: 2"><b><font color="#800000"><%=ierror%></font></b> </td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">用户名</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="text" name="name" size="100" style="color: #86540c; height: 20; width: 200"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">密 码</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="password" name="password" size="100" style="color: #86540c; height: 20; width: 200"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c"> </td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c">
              <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="30%" id="AutoNumber4">
                <tr><input type="hidden" name="action" value="manage">
                  <td width="50%">
                  <a target="_self" href="javascript:document.imanage.submit()"><img border="0" src="images/main/ok.gif"></a></td>
                  <td width="50%">
                  <a target="_self" href="javascript:document.imanage.reset()"><img border="0" src="images/main/cancel.gif"></a></td>
                </tr>
              </table>
              </td>
            </tr>
          </table>
          </td></tr>
          </form>
        </table>
        </center>
      </div>
<%
else

if iaction = "exit" then
response.cookies("iadmin") = ""
response.redirect "index.asp"
response.end
end if

if iaction = "config" then
newadmin = request.form("name")
newpassword = request.form("password")
newretype = request.form("retype")
newtitle = request.form("title")
newhomepage = request.form("homepage")
newurl = request.form("url")
newmax = request.form("max")
newpagesize = request.form("pagesize")
newqqshow = request.form("qqshow")
newcolor1 = request.form("color1")
newcolor2 = request.form("color2")
newcolor3 = request.form("color3")

if newadmin = "" or newpassword = "" or newretype = "" or newtitle = "" or newhomepage = "" or newurl = "" or newmax = "" or newpagesize = "" or newqqshow = "" or newcolor1 ="" or newcolor2 = "" or newcolor3 = "" then
ierror = "有未填项"
end if
if newpassword <> newretype then
ierror = "两次输入的密码不同"
end if

if ierror = "" then
sql = "select * from config"
rs.open sql,conn,3,2
rs("admin") = newadmin
rs("password") = newpassword
rs("title") = newtitle
rs("homepage") = newhomepage
rs("url") = newurl
rs("max") = newmax
rs("pagesize") = newpagesize
rs("qqshow") = newqqshow
rs("color1") = newcolor1
rs("color2") = newcolor2
rs("color3") = newcolor3
rs.update
rs.close
set rs = nothing
ierror = "成功修改留言本设置 请单击退出"
end if
end if
%>
      <div align="center">
      <center>
      <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="590">
        <tr><td>
          <table border="0" cellpadding="2" cellspacing="1" style="border-collapse: collapse; border-style: solid; border-width: 1" bordercolor="#86540c" width="100%" id="AutoNumber1">
          <form name="iconfig" method="post" action="manage.asp" target="_self">
             <tr>
              <td width="100%" colspan="2" bgcolor="#e4c59a" bordercolor="#86540c"><p align="center" style="margin-top: 2"><b><font color="#800000"><%=ierror%></font></b> </td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">管理员</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="text" name="name" size="100" style="color: #86540c; height: 20; width: 200" value="<%=iadmin%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">管理密码</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="password" name="password" size="100" style="color: #86540c; height: 20; width: 200" value="<%=ipassword%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">确认密码</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="password" name="retype" size="100" style="color: #86540c; height: 20; width: 200" value="<%=ipassword%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">
              留言本标题</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="text" name="title" size="100" style="color: #86540c; height: 20; width: 200" value="<%=ititle%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">主页名称</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="text" name="homepage" size="100" style="color: #86540c; height: 20; width: 200" value="<%=ihomepage%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">主页地址</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="text" name="url" size="100" style="color: #86540c; height: 20; width: 200" value="<%=iurl%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">最长留言</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="text" name="max" size="100" style="color: #86540c; height: 20; width: 50" value="<%=imax%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">每页显示</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="text" name="pagesize" size="100" style="color: #86540c; height: 20; width: 50" value="<%=ipagesize%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">QQ 
              Show</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <select size="1" name="qqshow" style="height: 20">
          <option selected value="1">显示</option>
          <option value="0">隐藏</option>
          </select></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">
              自定颜色1</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="text" name="color1" size="100" style="color: #86540c; height: 20; width: 200" value="<%=icolor1%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">
              自定颜色2</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="text" name="color2" size="100" style="color: #86540c; height: 20; width: 200" value="<%=icolor2%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c">
              <p align="center" style="margin-top: 2"><font color="#800000">
              自定颜色3</font></td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c"> 
          <input type="text" name="color3" size="100" style="color: #86540c; height: 20; width: 200" value="<%=icolor3%>"></td>
            </tr>
            <tr>
              <td width="20%" bgcolor="#e4c59a" align="center" bordercolor="#86540c"> </td>
              <td width="80%" bgcolor="#e4c59a" bordercolor="#86540c">
              <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="45%" id="AutoNumber4" bgcolor="#e4c59a">
                <tr><input type="hidden" name="action" value="config">
                  <td width="33%">
                  <a target="_self" href="javascript:document.iconfig.submit()"><img border="0" src="images/main/ok.gif"></a></td>
                  <td width="33%">
                  <a target="_self" href="javascript:document.iconfig.reset()"><img border="0" src="images/main/cancel.gif"></a></td>
                  <td width="34%">
                  <a href="manage.asp?action=exit">
                  <img border="0" src="images/main/exit.gif"></a></td>
                </tr>
              </table>
              </td>
            </tr>
          </table>
          </td></tr>
          </form>
        </table>
        </center>
      </div>
<%
end if
response.write ibottom
%>
      </td>
      <td width="100" background="images/main/right.gif"> </td>
    </tr>
  </table>
  </center>
</div>
</body>

</html>
<%
conn.close
set conn = nothing
%>

⌨️ 快捷键说明

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