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

📄 select_sort.asp

📁 这《ASP网络编程从入门到精通》书中的全部源程序
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
dim rs
dim id
dim sort
dim sort_id
dim ssort_id
ssort_id=Request.QueryString("sort_id")
if isnumeric(ssort_id)=0 or ssort_id="" then
response.write "非法ID参数"
response.end
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open "select id,sort,sort_id from sort where id="&ssort_id,conn,1,1
if rs.eof and rs.bof then
'
else
id=rs("id")
sort=rs("sort")
sort_id=rs("sort_id")
end if
rs.close
set rs=Nothing

dim guide

guide=" >> "&sort
if sort_id<>0 then
for i=1 to 8 step 1
set rs=conn.execute("select id,sort,sort_id from sort where id="&sort_id)
if rs.eof and rs.bof then
'
else
sort_id=rs("sort_id")
guide=" >> <a href=select_sort.asp?sort_id="&rs("id")&">"&rs("sort")&"</a>" & guide
end if
rs.close
set rs=Nothing
next
end if
%>
<title>选择分类</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script language="javascript">
function sort_id(a){
window.opener.form.sort_id.value=a;
alert("已经成功选择了分类!");
window.close();
}
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border="0" cellpadding="0" cellspacing="5">
  <tr> 
    <td height="25" align="center" bgcolor="#f5f5f5">选 择 分 类</td>
  </tr>
  <tr> 
    <td>当前目录:<a href="select_sort.asp?sort_id=0">首页</a> <%=guide%></td>
  </tr>
  <tr> 
    <td> <%          
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open "select * from sort where sort_id="&ssort_id,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>没有下级分类:[<a style='cursor:hand' onClick='sort_id("&ssort_id&");'><font color='#0000FF'>选择“"&sort&"”分类</font></a>]</p>"
else
do while not rs.eof
%>
      <table border="0" cellpadding="0" cellspacing="0">
        <tr> 
         <%for i = 1 to 3%>
          <td bgcolor="#FFFFFF"> 
           <%if not rs.eof then%>
            <table border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="200" height="20"> · 
                  <a href="select_sort.asp?sort_id=<%=rs("id")%>"><%=rs("sort")%></a> 
                  [<a style="cursor:hand" onClick="sort_id(<%=rs("id")%>);"><font color="#0000FF">选择</font></a>] 
                </td>
              </tr>
            </table>
           </td>
            <%
				rs.movenext
			  end if
		   Next
%>
        </tr>
      </table>
      <%
loop 
end if
rs.close
set rs=nothing
%>
    </td>
  </tr>
</table>
<%
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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