简单分页函数一 常用 复制代码 代码如下:<% page=trim(request("page")) maxperpage=40 first=true last=true dim rs set rs=server.CreateObject("adodb.recordset") sql="select id,title,add1,cartype,isred,enterdate,hits from newnews where classtype=0 and pass=1 order by id desc" rs.open sql,conn,1,1 rs.pagesize=maxperpage totalpage=rs.pagecount if len(page)=0 then intpage=1 first=false else if cint(page)<=1 then intpage=1 first=false else if cint(page)>=rs.pagecount then intpage=rs.pagecount last=false else intpage=cint(page) end if end if end if if not rs.eof then rs.absolutepage=intpage end if for a=1 to maxperpage if rs.eof then exit for %>
<%if rs.pagecount>0 then %> 共有<%=rs.recordcount%>条|当前页<%=intpage%>/ <% =rs.pagecount%> <% end if %> <%if intpage>1 then%> ? page=1">首页 <%else%> 首页 <%end if%> <%if first then%> ? page=<%=intpage-1%>">上一页 <%else%> 上一页 <%end if%> <%if last and intpage |