设为首页收藏本站

新微赢技术网

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

分页问题求助

[复制链接]
跳转到指定楼层
1#
发表于 2009-12-27 02:18:15 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
搜索分页
shucity=request.form("shucity")
hotelname=request.form("name")
set rs=server.createobject("adodb.recordset")
sqltext="select * from hotelb where city like '%"&shucity&"%' and c_name like '%"&hotelname&"%'"
...
if not rs.eof then
rs.PageSize =5 '每页记录条数
result_num=rs.RecordCount '记录总数
maxpage=rs.PageCount
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
else
result_num=0
maxpage=0
page=0
end if
if not rs.eof then
for i=1 to rs.PageSize
内容显示。。。
rs.movenext
if rs.EOF then Exit For
next
end If
call LastNextPage(maxpage,page,result_num)
分页页面
Sub LastNextPage(pagecount,page,resultcount)
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table cellspacing=0 cellpadding=0 border=0>" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
Response.Write("<TD align=right>" & vbCrLf )
' Response.Write(font_style & vbCrLf )

if page<=1 then
Response.Write ("首页 " & vbCrLf)
Response.Write ("上一页 " & vbCrLf)
else
Response.Write("<A href=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
Response.Write("<A href=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
end if
if page>=pagecount then
Response.Write ("下一页 " & vbCrLf)
Response.Write ("尾页" & vbCrLf)
else
Response.Write("<A href=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
Response.Write("<A href=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A>" & vbCrLf)
end if

Response.Write(" 第" & "&nbsp;<INPUT TYEP=TEXT NAME=page SIZE=2 Maxlength=4 VALUE=" & page & ">&nbsp;" & "页" & vbCrLf & "<INPUT type=submit value=GO>")
Response.Write(" 共 " & pageCount & " 页" & vbCrLf)
Response.Write(" " & resultcount & " 条信息" & vbCrLf)
Response.Write("</TD>" & vbCrLf )
Response.Write("</TR></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
第一页能正常显示但第2页就没有搜索条件了,朋友们帮我看看怎么解决好吗,我不知道怎么把搜索条件传到下一页,该怎么写,请各位帮帮忙!!我真的弄不出来搞不出来!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by xuexi

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

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