北京网站建设分页代码
当前位置:主页 > 北京网络建设 > 行业资讯 >

<stype>
.fen1{ width:700px; height:20px; float:left; display:inline; text-align:center; margin-

left:4px; margin-top:7px;}
.fen1 a.aab{  border:#CCCCCC solid 1px;  text-align:center; padding:2px 5px; }
.fen1 a:hover.aab{  border:#DC9861 solid 1px; color:#000000;}
.fen1 a.aac{  border:#DC9861 solid 1px; color:#993300;text-align:center; padding:2px 5px;}
.fen1 a,.fen1 span{  border:#CCCCCC solid 1px;  text-align:center; padding:2px 5px;

width:100px; color:#666666;}
</stype>

 

 

 

<%a=request("a")
b=request("b")%>

   <%
page=clng(request("page"))  
Set rs=Server.CreateObject("ADODB.RecordSet")

if b <> "" then
sql="select * from product where a='"&a&"' and b='"&b&"'  order by id desc"
elseif a<>"" then
sql="select * from product where a='"&a&"' and b='"&b&"'  order by id desc"
else
sql="select * from product where a=9   order by id desc"
end if
rs.Open sql,conn,1,1

if rs.eof and rs.bof then
  response.Write("暂时没有记录")
else
%>
 
 
 <%
rs.PageSize=10
eee=10
fff=INT(eee/2)
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page 
for j=1 to rs.PageSize
%>


<ul>
<li class="ptu"><a href="#"><img src="<%=rs("img")%>" width="332px"

height="192px"></a></li>
<li class="ptitle"><p><a href="#"><%=rs("title")%

></a></p><span>http://www.pbottle.com</span></li>
<li class="purl"><p>枯地可耕地枯地非机动车枯地可耕地厅颗进可耕地枯地可耕地动车枯地

</p><span><img src="../images/tc.jpg"></span></li></ul>
 
 
<%
rs.movenext
if rs.eof then exit for
next
%>

 


<div class="fen1">

 

 <form method=Post action="product.asp?bigclassname=<%=bigclassname%>">
                          <%if Page<2 then     
    response.write "<span>首页</span> <span>上一页</span>&nbsp;"
  else
    response.write "<a href=product.asp?a="&a&"&b="&b&"&page=1>首页</a>&nbsp;"
    response.write "<a href=product.asp?a="&a&"&b="&b&"&page=" & Page-1 & ">上一页

</a>&nbsp;"
  end if %>
 
 
 
  <%if page="" then
  page=1
  end if%>
 
 
 
   <%if rs.pagecount <= eee then %>
   <% for ccc=1 to rs.pagecount%>  
    <%if ccc=page then%>
  <a class="aac" href="product.asp?a=<%=a%>&b=<%=b%>&page=<%=ccc%>"> <%=ccc%></a>
  <%else%>
  <a class="aab" href="product.asp?a=<%=a%>&b=<%=b%>&page=<%=ccc%>"> <%=ccc%></a>
  <%end if%>
  <%next%> 
  <%elseif rs.pagecount >eee then%> 
  <%if page < fff+1 then %> 
   <% for bb=1 to eee%>
  <%if bb=page then%>
  <a class="aac" href="product.asp?a=<%=a%>&b=<%=b%>&page=<%=bb%>"> <%=bb%></a>
  <%else%>
  <a class="aab" href="product.asp?a=<%=a%>&b=<%=b%>&page=<%=bb%>"> <%=bb%></a>
  <%end if%>
   <%next%>   
     <%else%>
  <%aaa=page-fff%>
    <%bbb=page+fff%>
 <%if bbb > rs.pagecount then
 bbb=rs.pagecount
 end if%> 
 <%if page > rs.pagecount-fff then %>
 <%ddd=bbb-eee%>
 <% for bb=ddd to bbb%>  
    <%if bb=page then%>
  <a class="aac" href="product.asp?a=<%=a%>&b=<%=b%>&page=<%=bb%>"> <%=bb%></a>
  <%else%>
  <a class="aab" href="product.asp?a=<%=a%>&b=<%=b%>&page=<%=bb%>"> <%=bb%></a>
  <%end if%>
  <%next%>
  <%else%>
   <% for bb=aaa to bbb%>  
    <%if bb=page then%>
  <a class="aac" href="product.asp?a=<%=a%>&b=<%=b%>&page=<%=bb%>"> <%=bb%></a>
  <%else%>
  <a class="aab" href="product.asp?a=<%=a%>&b=<%=b%>&page=<%=bb%>"> <%=bb%></a>
  <%end if%>
  <%next%>
  <%end if%>
 <%end if%>
<%end if%>  
  <%
  if rs.pagecount-page<1 then
    response.write "<span>下一页</span> <span>尾页</span>"
  else
    response.write "<a href=product.asp?a="&a&"&b="&b&"&page=" & (page+1) & ">"
    response.write "下一页</a> <a href=product.asp?a="&a&"&b="&b&"&page="&rs.pagecount&">

尾页</a>"
  end if
  'response.write "&nbsp;页次:<strong><font

color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
    'response.write "&nbsp;共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录

<b>"&rs.pagesize&"</b>条记录/页"
   'response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input

value="&page&">"
  ' response.write " <input class=input type='submit'  value=' Goto ' 

name='cndok'></span></p>"    
%>
                        </form>  <%
end if
rs.close
set rs=nothing
%>

(发布时间:2012-11-17 22:55)


QQ在线咨询
点击这里给我发消息
点击这里给我发消息
24小时咨询热线
18801079534
客服咨询热线
010-86399882
  • 致电我们
  • 公司地址