<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
<tr>
<td>
<%'开始分页
Const MaxPerPage=5
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page"
) then
currentPage=Cint(request("page"
)
else
currentPage=1
end if
if zclassid="" then
set rs=server.CreateObject("adodb.recordset"
rs.open "select top 10 qch,jj,rq,bookid,bookname,bookzz,bookchuban,shichangjia,huiyuanjia,dazhe,bookdate,bookpic from shop_books order by adddate desc",conn,1,1
else
set rs=server.CreateObject("adodb.recordset"
rs.open "select bookid,bookname,bookzz,bookchuban,shichangjia,huiyuanjia,dazhe,bookdate,bookpic from shop_books where zclassid="&zclassid&" order by adddate desc",conn,1,1
end if
if err.number<>0 then
response.write "数据库中无数据"
end if
if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> 对不起,此分类暂时还没有商品!</p>"
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,"class.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"class.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"class.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%if zclassid="" then
response.write "<tr><td><img src=images/newbooks.gif width=520 height=31 alt=新到商品TOP20></td></tr>"
else
dim rs2,zname,nname,aname,tmpid
set rs2=server.CreateObject("adodb.recordset"
rs2.open "select * from shop_zclass where zclassid="&zclassid,conn,1,1
tmpid=rs2("nclassid"
zname=rs2("zClass"
rs2.close
rs2.open "select * from shop_nclass where nclassid="&tmpid,conn,1,1
tmpid=rs2("anclassid"
nname=rs2("nClass"
rs2.close
rs2.open "select * from shop_anclass where anclassid="&tmpid,conn,1,1
aname=rs2("anClass"
rs2.close
set rs2=nothing
response.write "<tr><td width=520 height=31><b>"&aname&"-"&nname&"-"&zname&"</b></td></tr>"
end if%>
<tr>
<td>
<%
do while not rs.eof%>
<div align="center">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td height="1" colspan="2" valign="top" bgcolor="#cccccc"></td>
</tr>
<tr>
<td width="18%" valign="top">
<div align="center">
<table width="65" height="94" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#FFFFFF">
<%
response.Write "<a href=book.asp?id="&rs("bookid"
&">"
if trim(rs("bookpic"
)<>"" then
response.Write "<img src="&trim(rs("bookpic"
)&" width=120 height=120 border=0 ></a>"
else
response.Write "<img src=images/emptybook.gif width=65 height=96 border=0></a>"
end if%><img src="../images/spacer.gif" width="12" height="1"></td>
</tr>
</table>
</div>
</td>
<td width="82%">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" height="10">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="60%" height="30"><strong><font class="bookn"><%=trim(rs("bookname"
)%></font></strong></td>
<td width="40%"><img border="0" src="IMAGES/index_ic01.gif" width="73" height="17"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3"><font color="#999966"><%=trim(rs("bookzz"
)%></font></td>
</tr>
<tr>
<td colspan="3" height="30"><a href="book.asp?id=<%=rs("bookid"
%>"><img border="0" src="IMAGES/btn_moreinfo.gif" width="64" height="17"></a></td>
</tr>
<tr>
<td background="images/line_broke01.gif" colspan="2"><img height="5" alt="" src="images/line_broke01.gif" width="16" border="0"></td>
</tr>
<tr><td height="5"></td></tr>
<tr>
<td colspan="3"> <%=trim(rs("bookdate"
)%></td>
</tr>
<tr>
<td width="37%"><%=formatnumber(rs("shichangjia"
,2)&"元"%>(会员价<%=formatnumber(rs("huiyuanjia"
,2)&"元"%>
</td>
<td width="63%" align="right">
<%response.write "<a href=# onClick=""javascript:window.open('shopping.asp?id="&rs("bookid"
&"','','width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;""><img src=images/gm.gif border=0></a>"%></td>
</tr>
<tr><td height="10" colspan="2"></td></tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" valign="top" height="1"></td>
</tr>
</table>
</div>
<%
i=i+1
if i>=MaxPerPage then Exit Do
rs.movenext
loop
rs.close
set rs=nothing
%>
</td>
</tr>
<tr><td height="1" bgcolor="#cccccc"></td></tr>
</table>
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n,ii
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If
Response.Write "<form method=Post action="&filename&"?zid="&zclassid&">"
If CurrentPage<2 Then
Response.Write "<font>首页 | 上一页 | </font> "
Else
Response.Write "<a href="&filename&"?page=1&zid="&zclassid&">首页</a> | "
Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&zid="&zclassid&">上一页</a> | "
End If
If n-currentpage<1 Then
Response.Write "<font>下一页 | 尾页</font>"
Else
Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&zid="&zclassid&">"
Response.Write "下一页</a> <a href="&filename&"?page="&n&"&zid="&zclassid&">尾页</a>"
End If
Response.Write "<font> 页次:</font><font>"&CurrentPage&"</font><font>/"&n&"页</font> "
Response.Write "<font> 共有"&totalnumber&"种商品 "
Response.Write "<font>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="¤tpage&">"
Response.Write " <input type='submit' value='GO' name='cndok'></form>"
End Function
%>
</td>
</tr>
</table>
请问怎么样才能使页码按 1 2 3 4 页这样来分,而不是上一页下一页