|
<%
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
strFileName="index.asp"
sql = "select * from guestbook order by id desc"
rs.open sql,conn,1,1
a = 0
if not rs.eof then
a = 1
MaxPerPage=4
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
end if
if currentPage=1 then
showContent
else
if (currentPage-1)*MaxPerPage
<%sub showcontent %>
<%
if not rs.eof then
for i=1 to MaxPerPage
%>
| 发言人:<%=rs("username")%> |
留言标题:<%=rs("title")%> |
|
留言于:<%=rs("datetime")%> |
|
<%
huifu=trim(rs("huifu"))
if(huifu<>"") then
%>
| 管理员回复:<%=huifu%> |
<%end if%>
<%
rs.movenext
if not rs.eof and i <> 4 then response.write " "
if rs.eof then exit for
next
else
%>
<%
end if
rs.close
%>
<%end sub%>
| <%If a = 1 Then showpage strFileName,totalput,MaxPerPage,true,true,""%>
|
|
|
|
|
|