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

📄 sort.asp

📁 这《ASP网络编程从入门到精通》书中的全部源程序
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
if session("admin")="" then
	response.write "<Script>window.alert('您目前还没有登录,请先登录!');location.replace('index.asp');</Script>"
end if

s_id=Request.QueryString("sort_id")				'读取sort_id 的值
if isnumeric(s_id)=0 or s_id = "" then			'sort_id 的值不是数字或者为空
	response.write "非法ID参数"				'给出提示
	response.end						'停止执行
end if
set rs=conn.execute("select * from sort where id="&s_id)
sort=rs("sort")
sort_id=rs("sort_id")
rs.close
set rs = nothing

dim locality
locality=" >> "&sort
if sort_id<>0 then
	for i=1 to 8 step 1
		set rs=conn.execute("select * from sort where id="&sort_id)
		if rs.eof and rs.bof then
			'
		else
			sort=rs("sort")    
			locality=" >> <a href=sort.asp?sort_id="&sort_id&">"&sort&"</a>"&locality  
			sort_id=rs("sort_id")   
		end if
		rs.close
		set rs = nothing
	next
end if
%>

<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.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>当前分类:<a href="sort_manage.asp">首页</a><%=locality%></td>
          </tr>
          <tr> 
            <td> 
<% 
set rs=server.createobject("adodb.recordset")            		'创建RecordSet 对象 
rs.open "select * from sort where sort_id="&s_id,conn,1,1		'从数据库中查询sort_id 列的值为s_id 的记录,将结果保存在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 3					'3表示每行显示三条记录
                  %>
                  <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")%>&sort_id=<%=rs("sort_id")%>">删除</a>]</td>
                      </tr>
                    </table>
                    <%
						rs.movenext		'指向下一条记录
					end if
					%>
                  </td>
                  <%
                  Next							'For循环结束
                  %>
                </tr>
              </table>
              <%
	loop								'Do While循环结束
end if

%>
            </td>
          </tr>
          <tr> 
            <td></td>
          </tr>
        </form>
      </table>
      
      
      
    </td>
  </tr>
  <tr>
    <td align = center>[<a href="sort_edit.asp?act=add&sort_id=<%=s_id%>">添加分类</a>]</td>
  </tr>
</table>
<%
rs.close 
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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