<%
const MaxPerPage=16
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
dim title
title=request("txtitle")
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql
dim rs
sql="select * from gonggao order by id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn_gonggao,1,1
if rs.eof and rs.bof then
response.write "
还 没 有 任 何 文 章
"
else
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
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"news.asp"
else
if (currentPage-1)*MaxPerPage
·没有增加相关的信息
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>