网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP实例
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.用ASP开发一个在线考试程序(一).
.怎样做自己的二级域名(之一).
.用asp怎样编写文档搜索页面(6).
.使用ASP程序对“HTML炸弹”进行屏.
.使用VB编写纯ASP程序.
.一个免费的邮件列表源程序(三).
.多个表单和多个图片一起上传完美.
.利用ASP存取各种常用类型数据库(.
.用DataList控件开发一个简单的留.
.显示页面show.asp--基于web的QQ程.
.ASP实现多域名同一空间的处理实例.
.asp+版本简单的留言板的制作(二).
.ASP.Net写的浏览器间谍.
.ASP中实现文件上传方法的研究.
.一个BBS的源代码(一).
.用asp实现的代码批量修改程序.
.ASP 编程中20个非常有用的例子.
.无组件图文混合上传示例.
.ASP程序界面的多语言支持.
.ASP中的函数应用方法及应用举例(.

简单的浮点论坛

发表日期:2001-9-4


简单的做了一个,扫描一次数据库可得一棵树
-----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="pic/send.gif" width="51" height="19">
</td>
</tr>
</table>
</form></div>

</body>

</html>
-----replay.asp---------

<% id = request("id")%>
<% set dbr = server.createobject("adodb.recordset")%>
<% dbr.open "select * from forum where (id=" & id & ")",application("oledb") ,1,1%>
<html>

<head>
<title>浮点论坛</title></head>

<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>姓  名:</b></td>
<td width="88%">
<input type="text" name="name" size="50" class="name">
</td>
</tr>
<tr>
<td width="12%" class="title"><b>E-mail:</b></td>
<td width="88%">
<input type="text" name="email" size="50" class="box">
</td>
</tr>
<tr>
<td width="12%" class="title"><b>标  题:</b></td>
<td width="88%">
<input type="text" name="title" size="50" class="box" value="RE:<%=server.htmlencode(rtrim(dbr("title")))%>">
<input type="hidden" name="id" value="<%=request("id")%>">
</td>
</tr>
<tr>
<td width="12%" valign="top" class="title"><b>内  容:</b></td>
<td width="88%">
<textarea rows="5" name="comm" cols="48" class="box"></textarea>
</td>
</tr>
<tr>
<td width="12%"></td>
<td width="88%">
<input type="image" border="0" name="imageField" src="pic/send.gif" width="51" height="19">
</td>
</tr>
</table>
</form></div>
<% dbr.close %>
<% set dbr = nothing %>
</body>

</html>
-------add.asp------
<% if request("name")="" or replace(request("title"),"RE:","")="" then %>
<html>
<head>
<title>浮点论坛</title></head>

<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="60" class="title">姓名、标题不能为空</td>
</tr>
<tr>
<td align="center" height="30"><a href="index.asp" class="link">返回</a></td>
</tr>
</table>
</div>
</body>
</html>
<% 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("oledb"),1,1%>

<% tid=cint(dbr("maxid")) %>
<% dbr.close%>
<% dbr.open "select top 0 * from forum",application("oledb"),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 %>
<% else %>
<% d = request("id") %>
<% dbr.open "SELECT TOP 2 * FROM forum WHERE (id <= " & d & ") ORDER BY id DESC",application("oledb") ,1,1%>
<% if dbr.recordcount=1 then %>
<% inid=cdbl(dbr("id"))-(cdbl(dbr("id"))-0)/2%>
<% dbr.close %>

<% dbr.open "select top 0 * from forum",application("oledb"),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")%>

<% 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("oledb"),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 %>


上一篇:用Jmail做收取邮件附件的程序 人气:12740
下一篇:ASP数据库恢复的代码 人气:10820
浏览全部论坛的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐