日期:2012-11-06 浏览次数:21037 次
简单的做了一个,扫描一次数据库可得一棵树
-----index.asp------
<html>
<head>
<title>浮点论坛</title></head>
<body marginwidth="0" marginheight="0">
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="24" >
<tr>
<td width="80"> </td>
<td><a href="#form">发新贴</A></td>
</tr>
</table>
<br>
<table border="0" width="90%" cellspacing="0" cellpadding="0">
<% set dbr = server.createobject("adodb.recordset")%>
<% dbr.pagesize = 50 %>
<% dbr.CacheSize = dbr.pagesize %>
<% dbr.open "select * from forum where (isdel = 'n') order by id desc",application("oledb") ,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%" >姓名:<%=rtrim(dbr("name")) %></td>
<td width="25%" ><% if rtrim(dbr("email"))<>"" then %><%rtrim(dbr("email"))%><% end if %></td>
<td width="25%" >时间:<%= datevalue(dbr("thedate")) %></td>
<% a= cdbl(dbr("id")) %>
<% next %>
<td width="25%"><a href="reply.asp?id=<%=a%>">回复</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("comm"))),chr(13),"<br>") %></td>
</tr>
<% dbr.movenext %>
<% if dbr.EOF Then Exit For %>
<% next %>
<tr>
<td align="right" height="30" width="500"><a href="index.asp?pagelist=<%=CINT(pagelist)+1%> "><span class="link">>>更多</span></td>
<td align="right" height="30"> </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>姓 名:</b></td>
<td width="88%">
<input type="text" name="name" size="30" class="name">
</td>
</tr>
<tr>
<td width="12%" class="title"><b>E-mail:</b></td>
<td width="88%">
<input type="text" name="email" size="30" class="box">
</td>
</tr>
<tr>
<td width="12%" class="title"><b>标 题:</b></td>
<td width="88%">
<input type="text" name="title" size="30" class="box">
</td>
</tr>
<tr>
<td width="12%" valign="top" class="title"><b>内 容:</b></td>
<td width="88%">
<textarea rows="5" name="comm" cols="30" 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="19">
</td>
</tr>
&