<%'开始分页
Const MaxPerPage=12
dim totalPut
dim CurrentPage
dim TotalPages
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
dim rspro
dim j
j=0
set rspro=Server.createobject("adodb.recordset")
rspro.open "select * from Shop_Product order by id desc",conn,1,1
If not rspro.eof then
totalPut=rspro.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,"product.asp"
else
if (currentPage-1)*MaxPerPage
rf-1 |
rf-2 |
rf-3 |
rf-4 |
rf-5 |
rf-6 |
rf-7 |
rf-8 |
rf-9 |
|
<%
k=k+1
if k>=MaxPerPage then Exit Do
rspro.movenext
j=j+1
if j>=4 then
response.Write(" ")
j=0
end if
loop
End Sub
end if
%>
<%
Function showpage(totalnumber,maxperpage,filename)
Dim n
Dim selectm
Dim selectkey
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If
%>
|