Infinite level classification

Source: Internet
Author: User
A relatively simple page, similar to the CSDN forum on the left of the NS list

Describe:

1.

Data name: Tree.mdb

Table Name: Tree

Table structure: ID (self-edited) PID (digital) content (text) link (text)

2.

Photo: Endnode.gif Collapsed.gif back.gif (All in the IMG directory, can be modified)

3.

Code:

<!--#include file= "Conn.inc"-->
<HTML>
<HEAD>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "generator" content= "Microsoft FrontPage 4.0" >
<TITLE> Unlimited Level list </TITLE>
<!--
by Fason (2003-5-12)
-->
<style>
. node{
font-size:12px;
padding:0 0 2 0;
Margin-left:10;
height:22px;
}
img{
Vertical-align:middle;
width:11px;
height:11px;
}
A{text-decoration:none;font-size:12px;color:black}
. deeptree{
width:100%;
height:100%;
Backgound-color: #f2f2f2;
Overflow:auto;
}

</style>
</HEAD>
<body bgcolor= #f2f2f2 >
<nobr>
<div class= "Deeptree" >
<%
Newid=request.querystring ("id")
If newid= "" "or CInt (NEWID) <0 then newid=0
If IsNumeric (NEWID) Then
Listtree (CInt (NEWID))
End If

function Listtree (ID)
Dim rs
Dim imgfolder,imgfile
Dim link,href,parenthref
Dim Target,ahref,click
Target= the frame name specified by "main"
imgfolder= "img/" ' Default path
Set Rs=conn.execute ("SELECT *" (SELECT COUNT (*) from the tree where PID = t.id) as children, (select PID from the tree where id= "&am p;id& ") as parent from tree T where pid=" &id)
If not rs.eof then
Parenthref=request.servervariables ("URL") & "Id=" &rs ("parent")
If Id<>0 then Response.Write "<div class= ' node ' nowrap=true><a href= '" &parentHref& "' border=0 ></a> "&link&" </div> "
Rs.movenext
Loop
Rs.close:set rs=nothing
End If
End Function
Conn.close:set conn=nothing
%>

</div>
</nobr>
</BODY>
</HTML>


Conn.inc:

<%
Dim conn
Set conn = Server.CreateObject ("ADODB. Connection ")
Conn. Open "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & Server.MapPath ("Tree.mdb") & "; Persist Security Info=false "
%>

4. Test: Ie6,ns7,mozilla the test pass

The principle is relatively simple, wrong please correct me, thank you



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.