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

📄 sort_manage.asp

📁 这《ASP网络编程从入门到精通》书中的全部源程序
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
if session("admin")="" then
	response.write "<Script>window.alert('您目前还没有登录,请先登录!');location.replace('index.asp');</Script>"
end if
%>
<html>
<head>
<title>网站管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr bgcolor="#e9e9e9"> 
          <td width="65" height="25" valign="bottom"><table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr align="center"> 
                <td width="55" height="21"><a href="main.asp"><font color="#000000">网站管理</font></a></td>
              </tr>
            </table></td>
          <td width="65" valign="bottom"><table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr align="center"> 
                <td width="55" height="21"><a href="verify.asp"><font color="#000000">网站审核</font></a></td>
              </tr>
            </table></td>
         
          <td width="65" valign="bottom"><table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr align="center"> 
                <td width="55" height="21"><a href="sort_manage.asp"><font color="#000000">分类管理</font></a></td>
              </tr>
            </table></td>

          <td width="65" valign="bottom"><table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr align="center"> 
                <td width="55" height="21"><a href="login.asp?action=logout"><font color="#000000">退出系统</font></a></td>
              </tr>
            </table></td>
          <td></td>
        </tr>
        <tr bgcolor="#000000"> 
          <td height="3" colspan="10" valign="bottom"></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="20">
    </td>
  </tr>
  <tr> 
    <td height="15"></td>
  </tr>
  <tr> 
    <td height="100%" valign="top"> 
      <table border="0" cellpadding="0" cellspacing="5">
	  <form name="form" method="get" action="sort_ok.asp">
        <tr> 
           <td>
<% 
dim rs
set rs=server.createobject("adodb.recordset")             			'创建RecordSet 对象
rs.open "select * from sort where sort_id=0",conn,1,1				'从数据库中查询sort_id = 0的记录,即最上层记录,然后保存在rs中
if rs.eof and rs.bof then											'不存在满足条件的记录
'
else																'存在满足条件的记录
	do while not rs.eof												'循环显示所有记录
%>
		   
            <table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
              <%
              for i = 1 to 4										'4表示一行显示四个分类记录
              %>
                <td width="250" bgcolor="#FFFFFF"> 
                  <%
                  if not rs.eof then								'记录还没到最后一条
                  %>
                  <table border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td width="225" height="20" align = center> &nbsp;<a href="sort.asp?sort_id=<%=rs("id")%>"><b><%=rs("sort")%></b></a> 
                      </td>
                    </tr>
                    <tr> 
                      <td height="25" align = center>
                        [<a href="sort_edit.asp?act=edit&sort=<%=rs("sort")%>&show=<%=rs("show")%>&sort_id=<%=rs("sort_id")%>&id=<%=rs("id")%>">编辑</a>][<a href="sort_ok.asp?action=delete&id=<%=rs("id")%>">删除</a>]</td>
                    </tr>
                  </table>                
              	  <%
			rs.movenext									'指向下一条记录
		  end if
		  %>
		</td>
	      <%
	      Next												'For循环结束
	      %>
              </tr>
            </table>
<%
	loop															'Do While循环结束
end if
rs.close 															'关闭RecordSet 对象
set rs=nothing
%>
          </td>
        </tr>
        <tr>
          <td></td>
        </tr>
		</form>
      </table>
      
      
      
    </td>
  </tr>
  <tr>
    <td align = center>[<a href="sort_edit.asp?act=add&sort_id=0">添加分类</a>]</td>
  </tr>
  <tr><td></td></tr>
</table>
</body>
</html>
<%
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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