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

📄 admin.title.asp

📁 使用说明: --- --- --- --- --- --- --- --- --- --- --- --- ---- 1:这是本人最早用过的
💻 ASP
字号:
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>后台管理</title>
<style>
<!--
table, body, tr, td, main, a, input, textarea, select        { font-family: 宋体; font-size: 9pt; text-decoration: none }
-->
</style>
</head>

<body>
<!--#include file="conn.asp"-->
<%
'-------------------open del
if Request("id")<>"" and Request("del")="del" then
Response.Write("你确定删除吗?<a href=?del=yes&id="&Request("id")&"&title="&Request("title")&"&>[Yes]</a>  <a href=?>[No]</a>")
Response.End
End if
if Request("del")="yes" and Request("id")<>"" then 
set rsdel=server.createobject("adodb.recordset")
if Request("title")="title_1" then rsdel.open "Delete * from title_1 where id = "&Request("id")&" ",conn,1,3
if Request("title")="title_2" then rsdel.open "Delete * from title_2 where id = "&Request("id")&" ",conn,1,3
Response.Write("删除成功! <a href=?>返回</a> ")
Response.End
rsdel.close
set rsdel = nothing
End if
'-----------------exit del
'-----------------open add and open update1
if Request("id")="" and Request("post")="title_1" and Request.form("title_1")<>"" then
set rs1=server.createobject("adodb.recordset")
rs1.open "select * from title_1",conn,1,3
rs1.addnew
rs1("title_1")=HTMLEncode(Request("title_1"))
rs1.update
Response.Write("添加成功! <a href=?>返回</a> ")
Response.End
rs1.close
set rs1 = nothing
End if
if Request("id")<>"" and isnumeric(Request("id")) and Request("post")="title_1" and Request.form("title_1")<>"" then
set rsup1=server.createobject("adodb.recordset")
rsup1.open "select * from title_1 where id = "&Request("id")&" ",conn,1,3
rsup1("title_1")=HTMLEncode(Request("title_1"))
rsup1.update
Response.Write("修改成功! <a href=?>返回</a> ")
Response.End
rsup1.close
set rsup1 = nothing
End if
'-----------------exit add and exit update2
if Request("id")="" and Request("post")="title_2" and Request.form("title_2")<>"" then
set rs2=server.createobject("adodb.recordset")
rs2.open "select * from title_2",conn,1,3
rs2.addnew
rs2("title_1")=HTMLEncode(Request("r1"))
rs2("title_2")=HTMLEncode(Request("title_2"))
rs2.update
Response.Write("添加成功! <a href=?>返回</a> ")
Response.End
rs2.close
set rs2 = nothing
End if
if Request("id")<>"" and isnumeric(Request("id")) and Request("post")="title_2" and Request.form("title_2")<>"" then
set rsup2=server.createobject("adodb.recordset")
rsup2.open "select * from title_2 where id = "&Request("id")&" ",conn,1,3
rsup2("title_1")=HTMLEncode(Request("r1"))
rsup2("title_2")=HTMLEncode(Request("title_2"))
rsup2.update
Response.Write("修改成功! <a href=?>返回</a> ")
Response.End
rsup2.close
set rsup2 = nothing
End if

'-----------------exit add and exit update
%>
<div align="center">
  <center>
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: 4px double #808080; padding: 3" bordercolor="#111111" width="95%">
    <tr>
      <td width="100%">
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
        <tr>
          <td width="100%" height="35" align="center"><a href="admin.title.asp">
          栏目分类管理</a>&nbsp;&nbsp; <a href="admin.article.asp">文章管理</a>&nbsp;
          <a href="admin.link.asp">友情链接管理</a>&nbsp; <a href="admin.user.asp">
          管理员管理</a>&nbsp; <a href="admin.login.asp?post=quit">退出系统</a></td>
        </tr>
        <tr>
          <td width="100%" align="center"><hr noshade color="#808080" size="1"></td>
        </tr>
        <tr>
          <td width="100%" align="center">
          <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#808080" width="100%">
            <tr>
              <td width="460" height="25" bgcolor="#F7F7F7" align="center">一级分类</td>
              <td width="461" height="25" bgcolor="#F7F7F7" align="center">二级分类</td>
            </tr>
            <%
            set rst1=server.createobject("adodb.recordset")
            rst1.open "select * from title_1 ",conn,1,3
            if not rst1.eof then
            for i1=1 to rst1.recordcount
            %>
            <tr>
              <td width="460" align="center" height="30">
              <%=rst1("title_1")%>  [<a href="?update=title_1&title_1=<%=rst1("title_1")%>&id=<%=rst1("id")%>">修改</a>]  [<a href="?del=del&id=<%=rst1("id")%>&title=title_1">删除</a>]
              </td>
              <td width="461" align="center" height="30">
              <%
              set rst2=server.createobject("adodb.recordset")
              rst2.open "select * from title_2 where title_1 = '"&rst1("title_1")&"' ",conn,1,3
              if not rst2.eof then
              for i2=1 to rst2.recordcount
              Response.Write rst2("title_2")&"[<a href='?update=title_2&title_2="&rst2("title_2")&"&id="&rst2("id")&"&r1="&rst2("title_1")&"'>修改</a>]  [<a href='?del=del&id="&rst2("id")&"&title=title_2'>删除</a>]     "
              rst2.movenext
              if rst2.eof then exit for
              next
              end if
              %>
              </td>
            </tr>
            <%
            rst1.movenext
            if rst1.eof then exit for
            next
            End if
            %>
<%
rst1.close
set rst2 = nothing
%>
          </table>
          </td>
        </tr>
        <tr><form method="POST" action="?update=title_1&id=<%=Request("id")%>&post=title_1">
          <td width="100%" align="center" height="35">
            <p>
            添加/修改一级分类 
            <input type="text" name="title_1" size="40" style="border-left: 1px solid #FFFFFF; border-right: 1px solid #FFFFFF; border-top: 1px solid #FFFFFF; border-bottom: 1px solid #808080; padding: 0" value="<%=Request("title_1")%>">
            <input type="submit" value="提交" name="B1" style="border: 1px solid #FFFFFF; padding: 0">
          </td></form>
        </tr>
        <tr><form method="POST" action="?update=title_2&id=<%=Request("id")%>&post=title_2">
          <td width="100%" align="center" height="30">
            <p>添加/修改二级分类 <select name="r1">
          <option selected >请选择一级分类</option>
          <%
          set rsr1=server.createobject("adodb.recordset")
          rsr1.open "select * from title_1",conn,1,3
          if not rsr1.eof then
          for r1 = 1 to rsr1.recordcount
          %>
          <option value="<%=rsr1("title_1")%>" <%if Request("r1")=rsr1("title_1") then Response.Write("selected")%>><%=rsr1("title_1")%></option>
          <%
          rsr1.movenext
          if rsr1.eof then exit for
          next
          End if
          rsr1.close
          set rsr1 = nothing
          %>
          </select>&nbsp;
            <input type="text" name="title_2" size="20" style="border-left: 1px solid #FFFFFF; border-right: 1px solid #FFFFFF; border-top: 1px solid #FFFFFF; border-bottom: 1px solid #808080; padding: 0" value="<%=Request("title_2")%>">
            <input type="submit" value="提交" name="B1" style="border: 1px solid #FFFFFF; padding: 0">
          </td></form>
        </tr>
      </table>
      </td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>

⌨️ 快捷键说明

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