-
您的位置:首页 → 网页设计 → ASP实例 → 简单的浮点论坛
简单的浮点论坛
时间:2004/11/7 2:57:00来源:本站整理作者:蓝点我要评论(0)
-
简单的做了一个,扫描一次数据库可得一棵树
-----index.asp------
浮点论坛
<% 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 %>
姓名:<%=rtrim(dbr("name")) %> |
<% if rtrim(dbr("email"))<>"" then %><%rtrim(dbr("email"))%><% end if %> |
时间:<%= datevalue(dbr("thedate")) %> |
<% a= cdbl(dbr("id")) %>
<% next %>
回复 |
|
<%=rtrim(dbr("title")) %> |
<%=replace(server.htmlencode(rtrim(dbr("comm"))),chr(13)," ") %> |
<% dbr.movenext %>
<% if dbr.EOF Then Exit For %>
<% next %>
>>更多 |
|
-----replay.asp---------
<% id = request("id")%>
<% set dbr = server.createobject("adodb.recordset")%>
<% dbr.open "select * from forum where (id=" & id & ")",application("oledb") ,1,1%>
浮点论坛
<% dbr.close %>
<% set dbr = nothing %>
-------add.asp------
<% if request("name")="" or replace(request("title"),"RE:","")="" then %>
浮点论坛
<% 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 %>
相关阅读
Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么
-
热门文章
没有查询到任何记录。
最新文章
迅雷新手完全入门手册
asp下面javascript上传图片限制格式大小方法告诉大家网页弹出窗口应用总结ASP常见错误类型大全asp常见错误分析和解决办法
人气排行
总是弹出visual studio 实时调试器 三种解决SQLSERVER存储过程及调用详解Asp获取真实IP地址ASP中连接Mssql的几种方法一个简单好用的UBB编辑器(含代码)如何用Split将字符串转换为数组并获取数组下ASP防止表单重复提交的办法告诉你免费的简单聊天室源代码
查看所有0条评论>>