设为首页收藏本站

新微赢技术网

 找回密码
 注册
搜索
热搜: 回贴
查看: 77|回复: 1
打印 上一主题 下一主题

我这个分页出错了(今天才发现有问题)

[复制链接]
跳转到指定楼层
1#
发表于 2010-1-20 03:26:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
大家帮看一下我这个分页,今天怎么才发现有问题呀,就是说,他第一页总是显示全部记录呀?
我想主要是蓝色那一块出了问题了,可怎么看也不行呀

<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from bbs order by hfdate desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
对不起,目前还没有此类信息!
<%
else
dim maxperpage
dim sql
dim r
dim gstbookid
dim totalput
dim currentpage
dim totalpages
filename="bbs.asp"
if not isempty(request("page")) then
currentpage=cint(request("page"))
else
currentpage=1
end if
rs.pagesize=3
totalput=rs.recordcount
totalpage=rs.pagecount
maxperpage=rs.pagesize
if currentpage<1 then
currentpage=1
end if
if currentpage>totalpage then
currentpage=totalpage
end if
if currentpage=1 then
showcontent
showpages1
else
if (currentpage-1)*maxperpage<totalput then
rs.move (currentpage-1)*maxperpage
dim bookmark
bookmark=rs.bookmark
showcontent
showpages1
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
%>
</div>
<%
sub showcontent
dim i,j

%>
<table width="760" height="27" border="0" align="center" cellpadding="0" cellspacing="0" background="img4/bg1_r1_c1.gif">
<tr>
<td width="33"><div align="center" class="zz style2">状态</div></td>
<td width="314">&nbsp; <span class="style3">主 题</span></td>
<td width="76"><div align="center" class="style3">作 者</div></td>
<td width="68"><div align="center" class="style3">发布时间</div></td>
<td width="39"><div align="center" class="style3">回复</div></td>
<td width="40"><div align="center" class="style3">人气</div></td>
<td width="190"><div align="center" class="style3">最后更新时间</div></td>
</tr>
</table>
<table width="760" height="30" border="0" align="center" cellpadding="0" cellspacing="0" background="images2/bj.gif" bgcolor="#FFFFFF">
<%
i=1
do while not (rs.eof or err)
%>
<tr>
<td width="33" height="30" align="center" valign="middle" bgcolor="#F4FAFB" class="b3"><%if rs("hfdate") = "2006-10-8" then%><img src="img2/ztop.gif" width="16" height="16"><%else%><img src="img4/folder.gif" width="16" height="16"><%end if%></td>
<td width="314" align="center" valign="middle" class="b2"><div align="left">&nbsp;<a href="new.asp?id=<%=rs("id")%>&zd=<%=rs("hfdate")%>"><%if rs("hfdate")= "2006-10-8" then%><font color="#FF0000"><%=left(rs("bt"),20)%></font><%else%><%=left(rs("bt"),20)%><%end if%></a></div></td>
<td width="76" align="center" valign="middle" bgcolor="#F4FAFB" class="b2"><%=rs("username")%></td>
<td width="69" align="center" valign="middle" class="b2"><%=rs("date")%></td>
<td width="38" align="center" valign="middle" bgcolor="#F4FAFB" class="b2"><%=rs("hfrs")%></td>
<td width="42" align="center" valign="middle" class="b2"><div align="center"><%=rs("rq")%></div></td>
<td width="188" align="center" valign="middle" bgcolor="#F4FAFB" class="b2"><div align="right"><%=rs("hfname")%> <span class="style1">|</span> <%if rs("hfdate")="2006-10-8" then%><%=rs("now")%><%else%><%=rs("hfdate")%><%end if%>&nbsp;</div></td>
</tr>
<%
if i>= maxprepage then exit do
i=i+1
rs.movenext
loop
%>
</table>
<%
end sub
%>
<%
sub showpages1()
dim n
n=totalpage
%>

<table width="760" height="30" border="0" align="center" cellpadding="0" cellspacing="0" background="images2/bj.gif" bgcolor="#FFFFFF" style="border-collapse:collapse">
<form action="<%=filename%>" method="post" align="right">
<tr>
<td width="238" height="30"></td>
<td width="522"><div align="right"><span style="font-size:12px">共<font color="#ff0000"><%=totalpage%></font>页/<font color="red"> <%=totalput%></font> 条信息</span>
[知识问答ωωω.χiuGoo.сom]
<% if currentpage <> 1 then %>
<a href=<%=filename%>><font color="#ff6600"><span style="font-size:12px">【首页】</span></font></a>&nbsp;<a href=<%=filename%>?page=<%=(currentpage-1)%>><font color="#ff6600"><span style="font-size:12px">【上一页】</span></font></a>
<%end if%>
<%if currentpage <> rs.pagecount then%>
<a href=<%=filename%>?page=<%=(currentpage+1)%>><font color="#ff6600"> <span style="font-size:12px">【下一页】</span></font></a>
<%end if%>
<span style="font-size:12px">第<font color="#ff6600"><%=currentpage%></font>页/共<font color="ff6600"><%=totalpage%></font>页
<%
response.write "转到:<select name='page' size=1 class=smallselsect style='font-family:宋体;font-size:12px;'>"
for i=1 to n
response.write"<option value="& i
if currentpage=i then
response.write " selected "
end if
response.write ">"& i &"</option>"
next
response.write "</select>"
response.write"<input name='types' type='hidden' value='"&request("types")&"'>"
response.write "&nbsp;<input class=buttonface type='submit' value='go' style='font-family: 宋体; font-size: 12px;'>"
%>
</span></div></td>
</tr>
</form>
</table>
<%end sub%>
</td>
</tr>
</table>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

申请友链|小黑屋|最新主题|手机版|新微赢技术网 ( 苏ICP备08020429号 )  

GMT+8, 2024-11-18 17:48 , Processed in 0.059114 second(s), 8 queries , Gzip On, Memcache On.

Powered by xuexi

© 2001-2013 HaiAn.Com.Cn Inc. 寰耽

快速回复 返回顶部 返回列表