打印

高手帮我看下哪里出错了。

能分页,分页正确。但第一页就显示了所有内容。请帮我看看哪里出错了!谢谢!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Response.ContentType = "text/vnd.wap.wml"%>
<!--#include file="conn.asp"-->
<!-- #include file="onlines.asp" --><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<%
dim id,page
id=request.QueryString("id")
page=cint(request.QueryString("page"))
if page="" or page<=0 then page=1

Function c2u(sGBStr)
Dim i,c
if sGBStr<>"" then
For i = 1 to Len(sGBStr)
c = Mid(sGBStr,i,1)
if c=chr(13) then
c2u = c2u & "<br/>"
else
c2u = c2u & "&#x" & Hex(AscW(c)) & ";"
end if
Next
end if
End Function
%>
<head><meta http-equiv='Cache-Control' content='no-cache'/>
</head>
<card title="文章列表">
<p>
<%
function pnname(x)
set rspp=Server.CreateObject("ADODB.Recordset")
rsstrp="select * from form where formid='" & request("id") & "'"
rspp.open rsstrp,conn,1,1
if rspp.recordcount<>0 then
pnname=c2u(rspp("id"))
end if
end function
dim rs
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select * from form where formid="&request("id")&" order by list",conn,1,1
if rs.recordcount > 0 then
response.write("共" & rs.recordcount & "帖("& page & "/" & (int(rs.recordcount/6)+1) &"页)<br/>")
rs.Move((page-1)*6)
dim j
j=1
response.write("----------<br/>")
if request("page")="" or request("page")="1" then
dim rs1
set rs1=server.createobject("adodb.recordset")
rs1.open "select * from form where formid="&request("id")&" order by list",conn,1,1
if rs1.bof and rs1.eof then
response.write ""
else
do while not rs1.eof
%><a href='list.asp?id=<%=rs1("id")%>&shouji=<%=request("shouji")%>'><%=rs1("form")%></a><br/>
<%
rs1.movenext
loop
end if
rs1.close
set rs1=nothing
end if
do while ((not rs.EOF) and j<=6)
%>
<%
rs.MoveNext
j=j+1
loop
end if
if page*6<rs.recordcount then
response.write("<a href='listform.asp?id="& id &"&page=" & page+1 & "&shouji="&request("shouji")&"'>下一页</a><br/>")
end if
if page>1 then response.write("<a href='listform.asp?id="& id &"&page=" & page-1 & "&shouji="&request("shouji")&"'>上一页</a><br/>")
rs.close
set rs=nothing
conn.close
set conn=nothing
%><anchor>[跳至]
<go href="listform.asp?shouji=<%=request("shouji")%>">
<postfield name="id" value="<%=id%>"/>
<postfield name="page" value="$(pages)"/>
</go>
</anchor>第<input name="pages" title="页码" type="text" format="*N" emptyok="true" size="3" maxlength="3"/>页</p><p>
----------<br/>
<a href="bbs.asp?shouji=<%=request("shouji")%>">[论坛首页]</a><br/>
<a href="../index.asp">[网站首页]</a><br/>
</p>
</card>
</wml>
貌似楼主缺少,每页最大的数量吧

rs.movenext
loop
前面加上
if i>MaxPerPage then exit do
这里的 Maxperpage 是你在开始时候定义的,每页显示的条数。
rsstrp="select * from form where formid='" & request("id") & "'",这里吧,应该有个限制吧,比如说top7?或者是XXX>0?
都不行,不过也是多谢俩位!

TOP

还在为头像烦恼?还在为不能关注好友动态烦忧?快来蓝色理想家园吧!