| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 660 人关注过本帖
标题:如何使分页显示四张图片?
只看楼主 加入收藏
xianghb
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-12-30
收藏
 问题点数:0 回复次数:2 
如何使分页显示四张图片?
这段代码只显示一张。我想改成四张 如何改代码呀。哪位朋友能帮帮我呀?非常感谢


<!--#include file="conn.asp"-->
<!--#include file="kw.asp"-->

<html>
<head>
<title>公司产品分类报价管理系统v2.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #7e1c19}
.STYLE3 {color: #000000}
-->
</style>
     
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border="0" width="750" cellspacing="0" cellpadding="0" align="center">
  <!-- Header -->
  <tr>
    <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0" height="55">
      <tr>
        <td width="27%" style="padding-left:20px;"><img border="0" src="img/top_logo.gif"></td>
        <td width="73%" class="p12" align="right" valign="bottom" style="padding-bottom:8px;padding-right:15px;"><a class="top" href="index.asp">首&nbsp; 页</a> |
        联系我们</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td width="100%"><img border="0" src="img/top_pic.gif" width="750" height="14"></td>
  </tr>
  <tr>
    <td width="100%" background="img/middle_pic_bg.gif" align="center"><table border="0" width="738" cellspacing="0" cellpadding="0" align="center">
      <tr>
        <td width="0" valign="top"><!-- Menu -->
        </td>
        <td width="738" valign="top" background="img/middle_pic_bg.gif"><!-- Content -->
              <table border="0" width="736" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="736" background="img/to_bj.jpg" class="p12" style="padding-left:20px;color:#747474;" height="28"> <a href="index.asp">所有产品</a> &gt; <span class="STYLE3">产品分类</span></td>
                </tr>
                <tr>
                  <td width="736" valign="top" background="img/bg.gif"><table border="0" width="100%" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="55%">  </td>
                        <form action="search.asp" style="background-color: #C0C0C0">
                        <td width="36%" valign="middle" background="img/bg_header_aurora.jpg"><p align="left">
                            <input type="text" name="search" class="goto" size="24">
                            <select name="select1" class="goto" id="select1" size="1" style="background-color: #C0C0C0">
                              <option value="1" selected>产品名称</option>
                              <option value="2">产品价格</option>
                              </select>
                                                </td>
                        <td width="9%" background="img/bg_header_aurora.jpg"><p align="left">
                            <input type="submit" name="Submit" class="goto" value="搜索">
                            
                                                </td>
                        </form>
                      </tr>
                      <tr>
                        <td colspan="3" class="td1"><table border="0" width="100%" cellspacing="6" cellpadding="0">
                            <tr>
                              <td width="100%" class="p12" height="40"><div align="center">
                                <%
                  dim aa1,aa2
                  aa1=trim(Request("a1"))
                  if aa1<>"" then
                  aa1="全部"
                  end if
                  
                  
                  aa2=request("a2")
                  pname2=trim(Request("keyword"))
                  if pname2<>"" then
                  d=" and name like  '%"&pname2&"%' "
                  end if
                  
                  bid=request("bid")
                 if bid<>""  then
                  c="and nbigarea="&bid&" "
                  end if
                  
                  sid=request("sid")
                  if sid<>""  then
                  c="and nsmallarea="&sid&" "
                  
                  end if
                  
        set rs=server.createobject("adodb.recordset")
        if session("user")="" then
        rs.open "select * from product where new=false "&c&" "&d,conn,1,1
        else
        rs.open "select * from product where "&c&" "&d,conn,1,1
        end if
        if rs.recordcount=0 then
        %>
                                <table border="0" cellspacing="0" cellpadding="5" align="center">
                                  <tr>
                                    <td width="436" align=center><img src="img/logo_shibai.gif" width="51" height="56"><br>
                                    暂时没有您想要的产品报价,也许我们正在整理中,请过会再来!</td>
                                  </tr>
                                </table>
                                <div align="left">
                                  <% else %>
                                  </font>
                                  <%
              rs.PageSize =20'每页记录条数
            iCount=rs.RecordCount'记录总数
            iPageSize=rs.PageSize
            maxpage=rs.pageCount
            page=request("page")
   
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
   
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
   
    rs.AbsolutePage=Page

    if page=maxpage then
        x=iCount-(maxpage-1)*iPageSize
    else
        x=iPageSize/2
    end if
    
            For i=1 To x            
            if rs.EOF or rs.BOF then exit for
            
        %>
                                </div>
                                <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"    bordercolorlight=#cccccc  bordercolordark=#ffffff>
                                  <tr>
                                    <td><div align="left">
                                        <!--#include file="shangping_j.asp"-->
                                    </div></td>
                                  </tr>
                                  <tr>
                                    <td><div align="center">
                                        <%

        rs.movenext
        if rs.eof then
response.write "<td align=center>&nbsp;</td></tr>"

end if
        if rs.EOF or rs.BOF then exit for
  

            
        %>
                                        <!--#include file="shangping_j.asp"-->
                                    </div></td>
                                  </tr>
                                </table>
                                <%

        rs.movenext
        
        next
        call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
        end if
        rs.close
        
        set rs=nothing
        
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
    Dim query, a, x, temp , p
    p=2
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

    query = Split(Request.ServerVariables("QUERY_STRING"), "&")
    For Each x In query
        a = Split(x, "=")
        If StrComp(a(0), "page", vbTextCompare) <> 0 Then
            temp = temp & a(0) & "=" & a(1) & "&"
        End If
    Next
    Response.Write("<table " & Table_style & ">" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=right><br>" & vbCrLf )
    Response.Write(font_style & vbCrLf )   
         if page<=1 then
        Response.Write (" <IMG height=21 src=images/point_left.gif width=19  style=vertical-align:bottom > " & vbCrLf)      
        Response.Write ("<IMG height=21 src=images/prev.gif  style=vertical-align:bottom   width=47>" & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "Page=1><IMG height=21  style=vertical-align:bottom;border:0 src=images/point_left.gif width=19></A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & "><IMG   style=vertical-align:bottom;border:0 height=21 src=images/prev.gif  width=47></A> " & vbCrLf)
    end if
    Response.Write(" 页码:" & page & "/" & pageCount & "页" &  vbCrLf)
    Response.Write("     " & iCount & " 条记录 " &  vbCrLf)
    if page>=pagecount then
        Response.Write ("<IMG height=21 src=images/next.gif width=46  style=vertical-align:bottom >  " & vbCrLf)
        Response.Write ("<IMG height=21   src=images/point_right.gif  width=18  style=vertical-align:bottom > " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & "><IMG height=21 src=images/next.gif width=46  style=vertical-align:bottom;border:0 > </A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & "><IMG height=21  style=vertical-align:bottom;border:0    src=images/point_right.gif></A> " & vbCrLf)            
    end if
    Response.Write("</TD>" & vbCrLf )  
    Response.Write("<td valign='bottom'>&nbsp;<select name='select' onChange='category(this.options[this.selectedIndex].value)'>")
    Response.Write("<option value=1 select>1</option>")
    do while p<=pageCount
    Response.Write("<option value='"&p&"'>"&p&"</option>")
    p=p+1
    loop
    Response.Write("</select></td>")
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub
%>
                            </div>                            </tr>
                            <tr>
                              <td valign="top" class="p12"><table width="94%" border="0" cellspacing="0" cellpadding="10">
                                <tr>
                                  <td width="74%" height="20" align="right" valign="bottom"><div align="left"><span class="STYLE1"> 版权所有:凡夫俗子---湖哥|技术支持:<a href="http://www. target="_blank">(QQ:49566906)</a> | <a href="http://www.miibeian. target="_blank" class="pro">粤ICP备:00000001号</a></span></div></td>
                                  <td width="3%" align="left" valign="top"></td>
                                  <td width="23%" align="left">&nbsp;&nbsp;&nbsp;
                                      <select name="links_url" onChange="links_url(document.all['links_url'].options[document.all['links_url'].selectedIndex].value)">
                    <option>--友情链接--</option>
                    <%
                    set rs = server.CreateObject("adodb.recordset")
                    rs.open "select * from links order by top",conn,1,1
                    do while not rs.eof or err
                    %>
                    <option value="<%=rs("url")%>"><%=rs("name")%></option>
                    <%
                    rs.movenext
                    loop
                    rs.close
                    set rs=nothing
                    %>
                </select></td>
                                </tr>
                              </table></td>
                            </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td colspan="3"></td>
                      </tr>
                  </table></td>
                </tr>
                <tr>
                  <td width="736"><img border="0" src="img/botuom_bj.jpg" width="736" height="9"></td>
                </tr>
            </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<table border="0" width="750" cellspacing="0" cellpadding="0" align="center">
  <!-- Footer -->
  <tr>
    <td width="100%" height="37" background="img/bottom_pic.gif"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="78%" class="p12" style="padding-left:15px;color:#8c8c8c;"><a class="top" href="index.asp">首 页</a> | 联系我们</td>
        <td width="22%" class="p11" align="center"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td width="100%" class="p10" height="25" style="color:gray;padding-left:10px;"> Copyright &copy; 2007 James CPLS Ver2.0, All Rights Reserved.</td>
  </tr>
</table>
<p> </p>
</body>
</html>
2007-12-30 22:58
lxn348567248
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2007-11-27
收藏
得分:0 
显示4个
<TABle>
do while not rs.eof
<TR>
for i = 1 to 4
<Td>
<%
if not rs.eof then%>  这是显示图片
<%else   reponse.write ""
end if%>
</td>
<%rs.movenext
next%>
</tr>
<%loop%>
</table>
这样就可以了.
2008-01-02 09:50
论坛元老
Rank: 1
等 级:新手上路
帖 子:812
专家分:0
注 册:2008-3-31
收藏
得分:0 
支持,顶....ding..
2008-04-02 15:22
快速回复:如何使分页显示四张图片?
数据加载中...
 
   



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

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