Simple to do one, scan a database can get a tree
-----index.asp------
<title> Floating Forum </title>
<body marginwidth= "0" marginheight= "0" >
<div align= "center" >
<table width= "100%" border= "0" cellspacing= "0" cellpadding= "0" height= ">"
<tr>
<TD width= > </td>
<td><a href= "#form" > New stickers </A></td>
</tr>
</table>
<br>
<table border= "0" width= "90%" cellspacing= "0" cellpadding= "0" >
<% Set DBR = Server.CreateObject ("Adodb.recordset")%>
<% dbr.pagesize =%>
<% DBR. CacheSize = Dbr.pagesize%>
<% dbr.open "SELECT * from forum where (Isdel = ' n ') Order BY id DESC", Application ("OLE DB"),1,1%>
<% Msgcount=dbr.recordcount%>
<% Msgpcount=dbr.pagecount%>
<% pagelist=request ("PageList")%>
<% if CINT (pagelist) > Dbr.pagecount then pagelist = Dbr.pagecount%>
<% if CINT (pagelist) < 1 then pagelist=1%>
<% DBR. Absolutepage=pagelist%>
<% for i= 1 to Dbr.pagesize%>
<tr>
<TD width= "100%" valign= "Top" align= "left" colspan= "2" >
<table border= "0" width= "100%" cellspacing= "0" cellpadding= "0" >
<tr>
<TD width= "25%" > Name: <%=rtrim (DBR ("name"))%></td>
<TD width= "25%" ><% if RTrim (DBR ("email")) <> "Then%><%rtrim (DBR (" email))%><% End If%> </td>
<TD width= "25%" > Time: <%= datevalue (DBR ("Thedate"))%></td>
<% a= CDbl (DBR ("id"))%>
<% Next%>
<TD width= "25%" ><a href= "reply.asp?id=<%=a%>" > Reply </a></td>
</tr>
</table>
</td>
</tr>
<tr>
<TD width= "100%" valign= "Top" align= "left" colspan= "2" ><%=rtrim (DBR ("title"))%></td>
</tr>
<tr>
<TD width= "100%" valign= "Top" align= "left" colspan= "2" ><%=replace (Server.HTMLEncode (RTrim ("DBR")) Chr (%></td>), "<br>"
</tr>
<% Dbr.movenext%>
<% if DBR. EOF Then Exit for%>
<% Next%>
<tr>
<TD align= "Right" height= "width=" ><a href= "Index.asp?pagelist=<%=cint (pagelist) +1%>" > <span class= "link" >>> more </span></td>
<TD align= "right" height= "> </td>
</tr>
</table>
<form method= "POST" action= "add.asp" >
<table border= "0" width= "90%" cellspacing= "0" cellpadding= "0" >
<tr>
<TD width= "12%" class= "title" ><b> name:</b></td>
<TD width= "88%" >
<input type= "text" name= "name" size= "class=" "Name" >
</td>
</tr>
<tr>
<TD width= "12%" class= "title" ><b>E-mail:</b></td>
<TD width= "88%" >
<input type= "text" name= "email" size= "class=" "box" >
</td>
</tr>
<tr>
<TD width= "12%" class= "title" ><b> title:</b></td>
<TD width= "88%" >
<input type= "text" name= "title" Size= "class=" "box" >
</td>
</tr>
<tr>
<TD width= "12%" valign= "Top" class= "title" ><b> content:</b></td>
<TD width= "88%" >
<textarea rows= "5" name= "comm" cols= "class=" "box" ></textarea>
</td>
</tr>
<tr>
<TD width= "12%" ></td>
<TD width= "88%" >
<input type= "image" border= "0" name= "ImageField" src= "Http://www.163design.net/a/q/pic/send.gif" Width= "51" Height= ">"
</td>
</tr>
</table>
</form></div>
</body>
-----replay.asp---------
<% id = Request ("id")%>
<% Set DBR = Server.CreateObject ("Adodb.recordset")%>
<% dbr.open "SELECT * from forum where (id=" & ID & ")", Application ("OLE DB"),1,1%>
<title> Floating Forum </title>
<body bgcolor= "#FFFCF0" leftmargin= "0" topmargin= "0" marginwidth= "0" marginheight= "0" >
<div align= "center" >
<form method= "POST" action= "add.asp" >
<table border= "0" width= "90%" cellspacing= "0" cellpadding= "0" >
<tr>
<TD width= "12%" class= "title" ><b> name:</b></td>
<TD width= "88%" >
<input type= "text" name= "name" size= "class=" "Name" >
</td>
</tr>
<tr>
<TD width= "12%" class= "title" ><b>E-mail:</b></td>
<TD width= "88%" >
<input type= "text" name= "email" size= "class=" "box" >
</td>
</tr>
<tr>
<TD width= "12%" class= "title" ><b> title:</b></td>
<TD width= "88%" >
<input type= "text" name= "title" Size= "class=" box "value=" Re:<%=server.htmlencode (RTrim ("title"))% > ">
<input type= "hidden" name= id "value=" <%=request ("id")%> ">
</td>
</tr>
<tr>
<TD width= "12%" valign= "Top" class= "title" ><b> content:</b></td>
<TD width= "88%" >
<textarea rows= "5" name= "comm" cols= "" class= "box" ></textarea>
</td>
</tr>
<tr>
<TD width= "12%" ></td>
<TD width= "88%" >
<input type= "image" border= "0" name= "ImageField" src= "Http://www.163design.net/a/q/pic/send.gif" Width= "51" Height= ">"
</td>
</tr>
</table>
</form></div>
<% Dbr.close%>
<% Set DBR = Nothing%>
</body>
-------add.asp------
<% If Request ("name") = "" or replace (Request ("title"), "RE:", "") = "" Then%>
<title> Floating Forum </title>
<body background= "pic/bg_bbs.gif" leftmargin= "0" topmargin= "0" marginwidth= "0" marginheight= "0"
< Div align= "center"
<table width= "450" border= "0" cellspacing= "0" cellpadding= "0"
<tr>
<TD height= "class=" "title" > name, Title cannot be empty </td>
</tr>
<tr>
<td align= "center" height= "><a" href= "index.asp" class= "link" > Return </a></td>
</tr>
</table>
</div>
</body>
<% response.end%>
<% End If%>
<% set DBR = Server.CreateObject ("Adodb.recordset")%>
<% if request ("id") = "then%>
<% dbr.open" SELECT Max (ID +1 as Maxid from forum ", Application (" OLE DB "), 1,1%>
<% Tid=cint (DBR ("Maxid"))%>
<% dbr.close%>
<% dbr.open "SELECT top 0 * from forum", Application ( "OLE DB"), 1,3%>
<%
dbr.addnew
DBR ("id") =tid
DBR ("title") =request ("title")
DBR ("comm") = Request ("comm")
DBR ("name") =request ("name")
DBR ("email") =request ("email")
DBR ("IP") = Request.ServerVariables ("REMOTE_ADDR")
DBR ("isdel") = "n"
DBR ("Thedate") =cdate (now)
Dbr.update
Dbr.close
%>
<% Set dbr = Nothing%>
<% Response.Redirect ("index.asp")%>
<% dbr.close%& Gt
<% Else%>
<% d = Request ("id")%>
<% dbr.open "SELECT top 2 * FROM forum WHERE (ID <=" & D & ") Order by ID DESC", Application ("OLE DB"), 1,1%>
<% if Dbr.recordcount=1 then%>
<% Inid=cdbl (d BR ("id"))-(CDbl (DBR ("id")) -0)/2%>
<% dbr.close%>
<% dbr.open "SELECT top 0 * from forum", Application ("OLE DB"), 1,3%>
<%
dbr.addnew
DBR ("id") =inid< br> DBR ("title") =request ("title")
DBR ("comm") =request ("comm")
DBR ("name") =request ("name")
DBR ("email") =request ("email")
DBR ("IP") =request.servervariables ("REMOTE_ADDR")
DBR ("isdel") = "n"
DBR ("thedate") = CDate (now)
Dbr.update
Dbr.close
%>
<% the Set dbr = Nothing%>
<% Response.Redirect (" Index.asp ")%>
<% ElseIf dbr.recordcount=2 then%>
<% Maxid = CDbl (DBR ("id"))%>
<% Dbr.movenext%>
<% MiniD = CDbl (DBR ("id"))%>
<% Dbr.close%>
<% inid=maxid-(Maxid-minid)/2%>
<%= iNID%>
<% dbr.open "SELECT top 0 * from forum", Application ("OLE DB"), 1,3%>
<%
Dbr.addnew
DBR ("id") =inid
DBR ("title") =request ("title")
DBR ("comm") =request ("comm")
DBR ("name") =request ("name")
DBR ("email") =request ("email")
DBR ("IP") =request.servervariables ("REMOTE_ADDR")
DBR ("Isdel") = "n"
DBR ("Thedate") =cdate (now)
Dbr.update
Dbr.close
%>
<% Set DBR = Nothing%>
<% Response.Redirect ("index.asp")%>
<% End If%>
<% End If%>