| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 478 人关注过本帖
标题:网页页数错误!点产品而产品老是出现一样
取消只看楼主 加入收藏
zyczi
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-6-2
收藏
 问题点数:0 回复次数:0 
网页页数错误!点产品而产品老是出现一样

<script language="JavaScript"> <!-- function demo(Page,scrl){ if (false)window.close(); if (!window.win || win.closed) { win=open(Page,"gouwu","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=2,width=450,height=350,scrollbars="+scrl+",resizable=1"); } else{ win.close(); win=open(Page,"gouwu","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=2,width=450,height=350,scrollbars="+scrl+",resizable=1"); } } //--> </script> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <body topmargin="0"> <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0"> <!--DWLayoutTable-->

<tr> <td width="993" height=1 ></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" > <!--DWLayoutTable--> <tr> <td width="993" height="308" valign="top" ><table width="100%" height="304" border="0" align="center" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="993" height="308" align="center" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <!--DWLayoutTable--> <tr> <td width="993" height="308" align="center" valign="top"> <%Const MaxPerPage=12 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 dim leixing leixing=request.QueryString("leixing") set rs=server.CreateObject("adodb.recordset") if leixing="big" then rs.open "select * from shop_books where anclassid="&anclassid&" order by adddate desc",conn,1,1 elseif leixing="small" then rs.open "select * from shop_books where anclassid="&anclassid&" and nclassid="&nclassid&" order by adddate desc",conn,1,1 elseif leixing="hot" then rs.open "select * from shop_books order by chengjiaocount desc",conn,1,1 elseif leixing="tejia" then rs.open "select * from shop_books where tejiabook=1 order by adddate desc",conn,1,1 elseif leixing="news" then rs.open "select * from shop_books where newsbook=1 order by adddate desc",conn,1,1 else rs.open "select * from shop_books where newsbook=1 order by adddate desc",conn,1,1 end if if rs.recordcount=0 then response.write "<center><br><font color=red size=2>对不起,暂时没有上传产品!</font></font>" 'response.End

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%> <%set rs=server.CreateObject("adodb.recordset") if leixing="big" then rs.open "select * from shop_books where anclassid="&anclassid&" order by adddate desc",conn,1,1 elseif leixing="small" then rs.open "select * from shop_books where anclassid="&anclassid&" and nclassid="&nclassid&" order by adddate desc",conn,1,1 elseif leixing="hot" then rs.open "select * from shop_books order by chengjiaocount desc",conn,1,1 elseif leixing="tejia" then rs.open "select * from shop_books where tejiabook=1 order by adddate desc",conn,1,1 elseif leixing="news" then rs.open "select * from shop_books where newsbook=1 order by adddate desc",conn,1,1 else rs.open "select * from shop_books where newsbook=1 order by adddate desc",conn,1,1 end if if rs.recordcount=0 then response.write "<center><br><font color=red size=2>对不起,暂时没有上传产品!</font></font>" 'response.End else %>   <table cellspacing=0 cellpadding=0 border=0 width="100%" ALIGN="CENTER"> <!--DWLayoutTable--> <% dim i_1,i_count i_1=int((rs.recordcount+1)/3) if i_1>10 then i_1=10 end if 'response.write i_1 for i_count=1 to i_1%> <tr> <td width="337" height="269" valign=top> <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"> <!--DWLayoutTable--> <TR> <TD WIDTH="337" height="189" valign="top"><TABLE WIDTH="95%" HEIGHT="204" BORDER="0" CELLPADDING=0 CELLSPACING=0 ALIGN="CENTER" > <!--DWLayoutTable--> <TR> <TD WIDTH="100%" HEIGHT="99" ALIGN="center" VALIGN="TOP"><TABLE HEIGHT=99 CELLSPACING=0 CELLPADDING=0 WIDTH=99 BORDER=0 ALIGN="center"> <TBODY> <TR> <TD ALIGN=center VALIGN="MIDDLE"> <%if rs("bookpic")="" then response.write "<div align=center><a href=list.asp?id="&rs("bookid")&" target=_blank><img src=images/emptybook.gif width=75 height=75 border=0></a></div>" else%> <A HREF=list.asp?id=<%=rs("bookid")%> TARGET=_blank><IMG SRC="<%=trim(rs("bookpic"))%>" WIDTH=110 BORDER=0 HEIGHT="110"></A> <%end if%> </TD> </TR> </TBODY> </TABLE></TD> </TR> <TR> <TD HEIGHT="18" ALIGN="center" VALIGN="MIDDLE"><FONT COLOR="#999999"> <%response.write "<a class=a4 href=list.asp?id="&rs("bookid")&" target=_blank><font color=#FF6600>" if len(trim(rs("bookname")))>22 then response.write left(trim(rs("bookname")),20)&"..." else response.write trim(rs("bookname")) end if response.write "</font></a>" %> </FONT></TD> </TR> <TR> <TD HEIGHT="18" ALIGN="CENTER" VALIGN="top"center"> <DIV ALIGN="CENTER"><FONT COLOR="#FF0000">¥</FONT><S><%=formatnumber(rs("shichangjia"),0)%></S> <FONT COLOR="#FF0000">-&gt;</FONT> <FONT COLOR=#FF6600><%=formatnumber(rs("huiyuanjia"),0)&"元"%></FONT></DIV></TD> </TR> <TR> <TD HEIGHT="53" VALIGN="top""> <table cellpadding=0 cellspacing=0> <!--DWLayoutTable--> <tbody> <tr> <td width="316" height="34" align="center" valign="middle">&nbsp;<a href="javascript:demo('gouwu.asp?id=<%=rs("bookid")%>&action=add');"><img src="images/goumai.gif" width="65" height="17" border=0></a><a href="javascript:;" onClick="javascript:window.open('shoucang.asp?id=<%=rs("bookid")%>&action=add','shouchang','width=450,height=350,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');">  <img src="images/shoucang1.gif" width="65" height="17" border=0></a></td> </tr> </tbody> </table></TD> </TR> <TR> <TD HEIGHT="16"">&nbsp;</TD> </TR> </TABLE> <%rs.movenext%> </TD> </TR> </TABLE></td> <td width="328" rowspan="2" valign="top" > <%if rs.eof then%> <%else%> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="95%" height="179" cellpadding=0 cellspacing=0 ALIGN="CENTER"> <!--DWLayoutTable--> <td width="100%" align="center" HEIGHT="99" VALIGN="TOP"><TABLE HEIGHT=99 CELLSPACING=0 CELLPADDING=0 WIDTH=99 BORDER=0 ALIGN="center"> <TBODY> <TR> <TD ALIGN=center VALIGN="MIDDLE"> <%if rs("bookpic")="" then response.write "<div align=center><a href=list.asp?id="&rs("bookid")&" target=_blank><img src=images/emptybook.gif width=75 height=75 border=0></a></div>" else%> <a href=list.asp?id=<%=rs("bookid")%> target=_blank><img src="<%=trim(rs("bookpic"))%>" width=110 border=0 height="110"></a> <%end if%> </TD> </TR> </TBODY> </TABLE></td> </tr> <TR> <td HEIGHT="18" align="center" VALIGN="MIDDLE"><FONT COLOR="#999999"> <%response.write "<a class=a4 href=list.asp?id="&rs("bookid")&" target=_blank><font color=#FF6600>" if len(trim(rs("bookname")))>22 then response.write left(trim(rs("bookname")),20)&"..." else response.write trim(rs("bookname")) end if response.write "</font></a>" %> </FONT></td> </tr> <TR> <td HEIGHT="18" align="center" VALIGN="top"><FONT COLOR="#FF0000">¥</FONT><S><%=formatnumber(rs("shichangjia"),0)%></S> <FONT COLOR="#FF0000">-&gt;</FONT> <FONT COLOR=#FF6600><%=formatnumber(rs("huiyuanjia"),0)&"元"%></FONT></td> </tr> <TR> <td HEIGHT="42"><table cellpadding=0 cellspacing=0> <!--DWLayoutTable--> <tbody> <tr> <td width="316" height="34" align="center" valign="middle">&nbsp;<a href="javascript:demo('gouwu.asp?id=<%=rs("bookid")%>&action=add');"><img src="images/goumai.gif" width="65" height="17" border=0></a><a href="javascript:;" onClick="javascript:window.open('shoucang.asp?id=<%=rs("bookid")%>&action=add','shouchang','width=450,height=350,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');">  <img src="images/shoucang1.gif" width="65" height="17" border=0></a></td> </tr> </tbody> </table> &nbsp;</td> </tr> </table></td> </tr> </table> <%rs.movenext%> <%end if%> </td> <td width="328" rowspan="2" valign="top" > <%if rs.eof then%> <%else%> <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"> <TR> <TD><TABLE WIDTH="95%" HEIGHT="170" CELLPADDING=0 CELLSPACING=0 ALIGN="CENTER"> <!--DWLayoutTable--> <TD WIDTH="100%" ALIGN="center" HEIGHT="99" VALIGN="TOP"><TABLE HEIGHT=99 CELLSPACING=0 CELLPADDING=0 WIDTH=99 BORDER=0 ALIGN="center"> <TBODY> <TR> <TD ALIGN=center VALIGN="MIDDLE"> <%if rs("bookpic")="" then response.write "<div align=center><a href=list.asp?id="&rs("bookid")&" target=_blank><img src=images/emptybook.gif width=75 height=75 border=0></a></div>" else%> <A HREF=list.asp?id=<%=rs("bookid")%> TARGET=_blank><IMG SRC="<%=trim(rs("bookpic"))%>" WIDTH=110 BORDER=0 HEIGHT="110"></A> <%end if%> </TD> </TR> </TBODY> </TABLE></TD> </TR> <TR> <TD HEIGHT="18" ALIGN="center" VALIGN="MIDDLE"><FONT COLOR="#999999"> <%response.write "<a class=a4 href=list.asp?id="&rs("bookid")&" target=_blank><font color=#FF6600>" if len(trim(rs("bookname")))>22 then response.write left(trim(rs("bookname")),20)&"..." else response.write trim(rs("bookname")) end if response.write "</font></a>" %> </FONT></TD> </TR> <TR> <TD HEIGHT="18" ALIGN="center" VALIGN="top"><FONT COLOR="#FF0000">¥</FONT><S><%=formatnumber(rs("shichangjia"),0)%></S> <FONT COLOR="#FF0000">-&gt;</FONT> <FONT COLOR=#FF6600><%=formatnumber(rs("huiyuanjia"),0)&"元"%></FONT></TD> </TR> <TR> <TD HEIGHT="33"><table cellpadding=0 cellspacing=0> <!--DWLayoutTable--> <tbody> <tr> <td width="316" height="34" align="center" valign="middle">&nbsp;<a href="javascript:demo('gouwu.asp?id=<%=rs("bookid")%>&action=add');"><img src="images/goumai.gif" width="65" height="17" border=0></a><a href="javascript:;" onClick="javascript:window.open('shoucang.asp?id=<%=rs("bookid")%>&action=add','shouchang','width=450,height=350,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');">  <img src="images/shoucang1.gif" width="65" height="17" border=0></a></td> </tr> </tbody> </table> &nbsp;</TD> </TR> </TABLE></TD> </TR> </TABLE> <%rs.movenext%> <%end if%> </td> </tr> <tr> <td height="3"></td> </tr> <%next%> <% rs.close set rs=nothing%> </table> <%end if%> <% End Sub Function showpage(totalnumber,maxperpage,filename) Dim n If totalnumber Mod maxperpage=0 Then n= totalnumber \ maxperpage Else n= totalnumber \ maxperpage+1 End If Response.Write "<form method=Post action="&filename&"?leixing="&leixing&"&selectm="&selectm&"&selectkey="&selectkey&">" Response.Write "<p align='center' class='contents'> " If CurrentPage<2 Then Response.Write "<font class='contents'>首页 上一页</font> " Else Response.Write "<a href="&filename&"?leixing="&leixing&"&page=1&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>首页</a> " Response.Write "<a href="&filename&"?leixing="&leixing&"&page="&CurrentPage-1&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>上一页</a> " End If If n-currentpage<1 Then Response.Write "<font class='contents'>下一页 尾页</font>" Else Response.Write "<a href="&filename&"?leixing="&leixing&"&page="&(CurrentPage+1)&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>" Response.Write "下一页</a> <a href="&filename&"?leixing="&leixing&"&page="&n&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>尾页</a>" End If Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> " Response.Write "<font class='contents'> 共有"&totalnumber&"种商品 " Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="&currentpage&">" Response.Write "&nbsp;<input type='submit' class='contents' value='GO' name='cndok' ></form>" End Function %> </td> </tr> </table></td> </tr> </table></td> </tr> </table>

搜索更多相关主题的帖子: 网页 
2005-06-02 16:01
快速回复:网页页数错误!点产品而产品老是出现一样
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014538 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved