<%
dim records_pp '存储每页的新闻数
records_pp=5
dim total_pages '总的页数
dim page '当前页码
dim tatal_records
rem 获取页码
page=request.QueryString("p")
if isnumeric(page) then
page=cint(page)
else
page=1
end if
if page=0 then page=1 end if
if page<0 then page=1 end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select*from liuyanban order by date desc"
rs.open sql,cn,1,3
total_pages=(rs.recordcount-1) \ records_pp + 1
if page>total_pages then page=total_pages
for i=1 to (page-1)*records_pp
rs.movenext
next
tatal_records=rs.recordcount
%>
<%for i= 1 to records_pp
if rs.eof then exit for
%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f0f0f0">
<tr>
<td width="130" height="130"><div align="center"><img src="" width="110" height="117" alt="" /></div></td>
<td width="370" align="left" valign="middle"><table width="370" border="0" cellpadding="0" cellspacing="0" class="titleCopy">
<tr>
<td>留言人:<%=rs("name")%></td>
</tr>
<tr>
<td>签写日期:<%=rs("date")%></td>
</tr>
<tr>
<td>联系方式:<%=rs("lx")%></td>
</tr>
<tr>
<td>留言内容:<%=rs("word")%></td>
</tr>
<tr>
<td><span class="titleCopy2">[回复内容]<%=rs("reword")%></span></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="30"><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="9" align="center" valign="middle"></td>
</tr>
</table>
<%
rs.movenext
next
rs.close
set rs=nothing
cn.close
set cn=nothing
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40" align="center" valign="middle" class="titleCopy"><p><img src="pic/22.jpg" width="450" height="20" vspace="5" /><br />
[共<%=total_pages%>页]
[当前第<%=page%>页]
<a href="guestbook.asp?p=1">首页</a>
<a href="guestbook.asp?p=<%=page-1%>">上一页</a>
<a href="guestbook.asp?p=<%=page+1%>">下一页</a>
<a href="guestbook.asp?p=<%=tatal_page%>">尾页</a></p>
</td>
</tr>
</table>
这是我的分页
觉得有点奇怪!!!!!!!!!!!