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