分页
<tr>
<td><br>
<%
set rs = server.createobject("adodb.recordset")
tea_arttype=request("tea_arttype")
if tea_arttype="" then
sql="select * from tea_data order by id desc"
else
sql="select * from tea_data where tea_arttype = '" &tea_arttype & "' order by id desc"
end if
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.write "暂无新闻"
else
%>
<br />
<table width="91%" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="680" height="20"><table width="100%" height="27" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center">
<%
dim curpage,j
if request("page")="" then
curpage = 1
else
curpage = cint(request("page"))
end if
rs.pagesize = 17
rs.absolutepage = curpage
for j = 1 to rs.pagesize
%>
<td width="680" height="27" valign="middle"><table width="100%" height="24" border="0" cellpadding="0" cellspacing="0" background="images/xuxian.gif">
<tr>
<td width="82%" height="24" class="tdline"> <img src="images/bot.jpg" width="9" height="9" /> <a href="show.asp?id=<%=rs("id")%>" target="_blank"><%=rs("tea_topic")%></a></td>
<td width="18%" align="center" class="tdline"><font color="#5D5C5C">(<%=rs("tea_time")%>)</font></td>
</tr>
</table></td>
<%
if (j mod 1)=0 then response.write "</tr><tr><td></td></tr><tr align='center' background='images/probg.jpg'>"
rs.movenext
if rs.eof then
j = j + 1
exit for
end if
next
%>
</tr>
</table></td>
</tr>
</table>
<br />
<div align="left" class="12font">
<form action="" method="post">
<%
response.write "<center>"
response.write "第<font color=red>" + cstr(curpage) + "</font>页/总" + cstr(rs.pagecount) + "页 "
response.write "每页显示"&rs.pagesize&"个,总共有" + cstr(rs.recordcount) + "条信息 "
if curpage = 1 then
response.write "首页 前页 "
else
response.write "<a href='" & request.ServerVariables("script_name") & "?lx=" & request("lx") & "&page=1'>首页</a> <a href='" & request.ServerVariables("script_name") & "?lx=" & request("lx") & "&page=" + cstr(curpage-1) + "'>前页</a> "
end if
if curpage = rs.pagecount then
response.write "后页 末页"
else
response.write "<a href='" & request.ServerVariables("script_name") & "?lx=" & request("lx") & "&page=" + cstr(curpage+1) + "'>后页</a> <a href='" & request.ServerVariables("script_name") & "?lx=" & request("lx") & "&page=" + cstr(rs.pagecount) + "'>末页</a>"
end if
end if %>
转:
<select name='page' size='1' onchange='javascript:submit()' class="text1" >
<%for i = 1 to cint(rs.pagecount)%>
<option value='<%=i%>' <%if cint(request("page"))=cint(i) then%> selected="selected" <%end if%>>第<%=i%>页</option>
<%next%>
</select>
</form>
</div>
<%rs.close
set rs=nothing%></td>
</tr>
</table></td>
</tr>