asp分页问题????????????????????????

fanxianyun123 fanxianyun123 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

<%if request.form ("submit")<>"" then%>
<% dim keyword,serveryy,servertype,dktype,price1,price2
keyword=request.Form("keyword")
serveryy=to2312(request.Form("serveryy"))
servertype=to2312(request.Form("servertype"))
dktype=to2312(request.Form("dktype"))
price1=to2312(request.Form("price"))
price2=to2312(request.form("dprice"))
webname=to2312(request.Form("webname"))
sql="select * from ServerN,Webhost where ServerN.Webname=Webhost.Wname and ServerType='"& servertype &"'"
if keyword="" then
sql=sql
sqlurl="fwqss.asp?ServerType=" & servertype
else
sqlkeyword="and Content like '%"& keyword &"%'"
sql=sql+sqlkeyword
sqlurl="fwqss.asp?ServerType=" & servertype
end if
if serveryy="请选择" then
sql=sql
sqlurl="fwqss.asp?ServerType=" & servertype
else
if keyword<>"" then
sqlserveryy="and ServerYY='"& serveryy &"'"
else
sql="select * from ServerN,Webhost where ServerN.Webname=Webhost.Wname and ServerType='"& servertype &"'and ServerYY='"& serveryy &"'"
sqlurl="fwqss.asp?ServerType=" & servertype
end if
sql=sql+sqlserveryy
sqlurl="fwqss.asp?ServerType=" & servertype
end if
if dktype="请选择" then
sql=sql
sqlurl="fwqss.asp?ServerType=" & servertype
else
if keyword<>"" or serveryy<>"请选择" then
sqldktype="and DKType='"& dktype &"'"
sqlurl="fwqss.asp?ServerType=" & servertype
else
sql="select * from ServerN,Webhost where ServerN.Webname=Webhost.Wname and ServerType='"& servertype &"'and DKType='"& dktype &"'"
sqlurl="fwqss.asp?ServerType=" & servertype
end if
sql=sql+sqldktype
sqlurl="fwqss.asp?ServerType=" & servertype
end if
if price1="" or price2="" then
sql=sql
sqlurl="fwqss.asp?ServerType=" & servertype
else
if keyword<>"" or serveryy<>"请选择" or dktype<>"请选择" then
if not(isnumeric(price1)) then
response.write "<script>alert('价格请输入数字1!');history.back();</Script>" response.end end if
if not(isnumeric(price2)) then
response.write "<script>alert('价格请输入数字1!');history.back();</Script>"
response.end
end if
sqlprice="and Price>='"& price1 &"' and Price<='"& price2 &"'"
else
sql="select * from ServerN,Webhost where ServerN.Webname=Webhost.Wname and ServerType='"& servertype &"' and Price>='"& price1 &"' and Price<='"& price2 &"'"
sqlurl="fwqss.asp?ServerType=" & servertype
end if
sql=sql+sqlprice
sqlurl="fwqss.asp?ServerType=" & servertype
end if
if webname="请选择" then
sql=sql
sqlurl="fwqss.asp?ServerType=" & servertype
else
if keyword<>"" or serveryy<>"请选择" or price1<>"" or price2<>"" or dktype<>"请选择"then
sqldktype="and Webname='"& webname &"'"
else
sql="select * from ServerN,Webhost where ServerN.Webname=Webhost.Wname and ServerType='"& servertype &"' and Webname='"&webname &"'"
sqlurl="fwqss.asp?ServerType=" & servertype
end if
sql=sql+sqldktype
sqlurl="fwqss.asp?ServerType=" & servertype
end if
if servertype="请选择"then
response.write "<script>alert('必须输入类型!');history.back();</Script>"
response.end
end if
set rs1=server.CreateObject("adodb.recordset")
rs1.open sql,conn,1,1
%>
<%filepath=sqlurl%>
<%
rs1.PageSize = 10 '每页显示记录数
pagecount=rs1.PageCount
page=int(request.QueryString ("page"))
if page<=0 then page=1
if page>pagecount then page=pagecount
if request.QueryString("page")="" then page=1
rs1.AbsolutePage=page
%>
<%
if not rs1.eof then
%>
<tr>
<td><table width="537" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#808082">
<tr>
<td width="68" bgcolor="#CCCCCC">服务器托管名称</td>
<td width="77" bgcolor="#CCCCCC">机房名称</td>
<td width="55" bgcolor="#CCCCCC">设备类型</td>
<td width="55" bgcolor="#CCCCCC">带宽类型</td>
<td width="65" bgcolor="#CCCCCC">运营服务商</td>
<td width="34" bgcolor="#CCCCCC">原价</td>
<td width="45" bgcolor="#CCCCCC">会员价</td>
<td width="31" bgcolor="#CCCCCC">优惠</td>
<td width="80" bgcolor="#CCCCCC">信息录入时间</td>
</tr>
<%For I = 1 to rs1.PageSize
if rs1.EOF then
Exit For
end if %> <tr>
<td width="68" bgcolor="#ffffff"><%=rs1("ServerName")%></td>
<td width="77" bgcolor="#ffffff"><%=rs1("Wname")%></td>
<td width="55" bgcolor="#ffffff"><%=rs1("ServerType")%></td>
<td width="55" bgcolor="#ffffff"><%=rs1("DKType")%></td>
<td width="65" bgcolor="#ffffff"><%=rs1("ServerYY")%></td>
<td width="34" bgcolor="#ffffff"><%=rs1("Price")%></td<td width="45" bgcolor="#ffffff"><%=rs1("AccountPrice")%></td>
<td width="31" bgcolor="#ffffff"><%=rs1("UserPrice")%></td>
<td width="80" bgcolor="#ffffff"><%=rs1("AddTime")%></td>
</tr>
<%
rs1.movenext
next
%>
<%
else
response.write "<script>alert('暂无此产品!');history.back();</Script>"
response.end
end if
rs1.close
%> </table>
<form action="<%="fwqss.asp?ServerType='"& servertype &"'"%> method="get">
<%if page=1 and not page=pagecount then%>
[共<%=rs1.RecordCount%>篇<%=rs1.PageSize%>篇/页] 
[首 页] [上一页] 
<a href="<%=filepath%>&page=<%=page+1%>">[下一页]</a> 
<a href="<%=filepath%>&page=<%=pagecount%>">[尾 页]</a>
<%elseif page=pagecount and not page=1 then%>
[共<%=rs1.RecordCount%>篇<%=rs1.PageSize%>篇/页] 
<a href="<%=filepath%>&page=1">[首 页]</a> 
<a href="<%=filepath%>&page=<%=page-1%>">[上一页]</a> 
[下一页] [尾 页]
<%elseif page<1 then%>
<font color=red>没有任何记录!</font>
<%elseif page>pagecount then%>
<font color=red>没有任何记录!</font>
<%elseif page=1 and page=pagecount then%>
<%else%>
[共<%=rs1.RecordCount%>篇 <%=rs1.PageSize%>篇/页] 
<a href="<%=filepath%>&page=1">[首 页]</a> 
<a href="<%=filepath%>&page=<%=page-1%>">[上一页]</a> 
<a href="<%=filepath%>&page=<%=page+1%>">[下一页]</a> 
<a href="<%=filepath%>&page=<%=pagecount%>">[尾 页]</a>
<%end if%>
 [页次:<font color=red><%=page%></font>/<%=pagecount%>] 
转到<input name="page" size=5 value="<%=page%>">页
<input type="submit" value="GO!">
</form>
</td>
</tr><%end if%>
</table>
</td></tr></table></td></tr></table></td></tr></table>
</body>
<!--#include file="di.asp"-->
</html>
<%
set rs=nothing
set rs1=nothing
%>这是我的分页源码,为什么当我点下一页的时候,它显示的是什么也没有搜索的页面,当再点一次搜索才转到下一页呢?
...全文
评论 2
收藏 已收藏
分享
返回顶部
fanxianyun123
ASP 28,401 成员 356,940 内容