有关分页技术。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%
set rs=Server.createObject("Adodb.recordset")
sql="select * from mybook"
rs.open sql,conn,1,1
rs.pagesize=3
pagenum=request("pagenum")
if pagenum="" then
pagenum=1
rs.absolutepage=pagenum
else
rs.absolutepage=pagenum
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>要看留言</title>
<style type="text/css">
td{font-size:9pt}
</style></head>
<body>
<%
i=0
do while not rs.eof and i<rs.pagesize
%>
<table width="663" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0033CC">
<tr align="center">
<td height="18" bgcolor="#FFFFFF">留言人姓名:<%=rs("name")%></td>
<td width="125" bgcolor="#FFFFFF">留言标题:<%=rs("title")%></td>
<td bgcolor="#FFFFFF"><div align="left"></div>电子邮件:<a href="mailt<%=rs("mail")%>"><%=rs("mail")%></a></td>
<td width="185" bgcolor="#FFFFFF">个人主页:<a href=<%=rs("home")%>><%=rs("home")%></a></td>
</tr>
<tr align="center">
<td height="151" bgcolor="#FFFFFF">留言内容:</td>
<td colspan="2" align="left" valign="top" bgcolor="#FFFFFF"><%=rs("word")%><img src="gif/<%=rs("face")%>"></td>
<td bgcolor="#FFFFFF"> </td>
<%
i=i+1
rs.movenext
loop%>
</tr>
</table>
<table width="663" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td width="578" height="20"><p>共有:<%=rs.pagecount%>页 共有<%=rs.recordcount%>条记录 页次<%=pagenum%>/<%=rs.pagecount%> 你当前在第 <%=pagenum%>
页
<%if pagenum>1 then%>
[<a href="rword.asp?pagenum=<%=1%>">首页</a>]
<%else%>
[首页]
<%end if%>
<%if pagenum>1 then%>
<a href="rword.asp?pagenum=<%=pagenum-1%>">[上一页]</a>
<%else%>
[上一页]
<%end if%>
<%if pagenum<>rs.pagecount then%>
<a href="rword.asp?pagenum=<%=pagenum+1%>">[下一页]</a>
<%else%>
[下一页]
<%end if%>
<% If pagenum<>rs.pagecount Then %>
<a href="rword.asp?pagenum=<%= rs.pagecount %>">[尾页]</a>
<% Else %>
[尾页]
<%end if%>
<form name="form1" method="post" action="rword.asp">
<div align="center">
<select name="pagenum" size="1">
<% for i=1 to rs.pagecount %>
<option value="<%= i %>" selected <% If i=pagenum Then %> selected<% End If %>><%= i %></option>
<% next %>
</select>
<input name="Submit" type="submit" class="t" value="提交">
</div>
</form>
</td>
</tr>
</table>
<p> </p>
</body>
</html>
不知道为什么我点尾页后,到了尾页还能在点下去