<% sql="select * from gbook order by id desc" 'sql="select * from gbook where check=true order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql,connstr,1,1 i=0 if rs.eof then response.write "暂无留言!" else const maxperpage=15 dim currentpage rs.pagesize=maxperpage currentpage=request.querystring("pageid") if currentpage="" then currentpage=1 elseif currentpage<1 then currentpage=1 else currentpage=clng(currentpage) if currentpage > rs.pagecount then currentpage=rs.pagecount end if end if if not isnumeric(currentpage) then currentpage=1 end if dim totalput,n totalput=rs.recordcount if totalput mod maxperpage=0 then n=totalput\maxperpage else n=totalput\maxperpage+1 end if if n=0 then n=1 end if rs.move(currentpage-1)*maxperpage i=0 w=1 do while i< maxperpage and not rs.eof %>
<% if rs("huifu")<>"" then %> <% end if %>
姓名:<% if rs("mail")<>"" then %> " class="setred" title="电子信箱"><%=rs("name")%> <% else %> <%=rs("name")%> <% end if %>   (<%=rs("date")%>) <% if session("admin")<>"" then %> >删除 ">回复 修改密码 退出 <% end if %>
来自:<%=rs("address")%>  
留言:<%=rs("word")%> 
回复:<%=rs("huifu")%> 
<% i=i+1 rs.movenext loop rs.close end if %>

页数:<%=currentpage%>/<% =n%> <%k=currentpage if k<>1 then%> 首页 上一 <%else%> 首页 上一页 <%end if%> <%if k<>n then%> 下一 尾页 <%else%> 下一页 尾页 <%end if%> 共有<%=totalput%>