我正在坐个图片显示新闻前台,我想每行显示两个或三个小图片标题,例示http://www.makewing.com/lanren/png/这上面是每行显示两个图片,请高手帮我填加一下,谢谢~~~
我的代码如下:
<%
dim conn
dim rst
dim connstr
dim sqlstr
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &server.MapPath("/db/pic.mdb")
set conn=Server.CreateObject("ADODB.CONNECTION")
set rst=Server.CreateObject("ADODB.RECORDSET")
conn.open connstr
%>
<table width="92%" border="0" cellspacing="0" cellpadding="0">
<tr class="ziti">
<td align="center" valign="top" scope="col"><div align="left">
<%set rs=server.createobject("adodb.recordset")
sql="select * from gyhy_qyry where lb='飞机图片' order by ID desc"
rs.open sql,conn,1,1
if rs.recordcount=0 then
%>
<table width="370" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td align=center>暂无内容</td>
</tr>
</table>
<%
else
rs.PageSize =10 '每页记录条数
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
end if
For i=1 To x
%>
//<%这里好像有代码%>
<table width="100%" border="0" align="center" cellspacing="7">
<tr>
<td align="center" valign="top"><table width="160" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF">
//<%这里好像有代码%>
<table width="100" cellpadding="0" cellspacing="0" class="bianhui">
<tr>
<td><table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" bgcolor="#FFFFFF" class="bianquan"><table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td><img src="<%=rs("maxtu")%>" border="0" width="280" height="165"></a></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="4" class="biantop">
<tr>
<td align="center" valign="bottom" class="ziti" ><div align="center" class="ddyyCopy"><%=rs("biaoti")%> <br>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td align="center" valign="top" bgcolor="#FFFFFF">
<table width="140" height="" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td width="" height="" align="center" valign="top" bgcolor="#FFFFFF"><table width="100" cellpadding="0" cellspacing="0" class="bianhui">
<tr>
<td><table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" bgcolor="#FFFFFF" class="bianquan"><table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td><img src="<%=rs("maxtu")%>" border="0" width="280" height="165"></a></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="4" class="biantop" >
<tr>
<td align="center" valign="bottom" class="ziti" ><div align="center"><span class="ddyyCopy"><%=rs("biaoti")%> </span><br>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
//<%这里好像有代码%>
</td>
</tr>
</table>
//<%这里好像有代码%>
<table width="100%" height="18" border="0" cellpadding="0" cellspacing="0" class="ziti">
<tr>
<th height="18" scope="col"><div align="center" class="ddhh">
<%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
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 width=100% border=0 cellpadding=0 cellspacing=0 >" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR >" & vbCrLf )
Response.Write("<TD align=center height=35>" & vbCrLf )
Response.Write(font_style & vbCrLf )
if page<=1 then
Response.Write ("<font face=宋 体 color=#666666 size=2px>首 页 " & vbCrLf)
Response.Write ("<font face=宋 体 color=#666666 size=2px>上一页 " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=1 ><font face=宋 体 color=#666666 size=2px>首 页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & "><font face=宋 体 color=#666666 size=2px>上一页</A> " & vbCrLf)
end if
if page>=pagecount then
Response.Write ("<font face=宋 体 color=#666666 size=2px>下一页 " & vbCrLf)
Response.Write ("<font face=宋 体 color=#666666 size=2px>尾 页 " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & "><font face=宋 体 color=#666666 size=2px>下一页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & "><font face=宋 体 color=#666666 size=2px>尾 页</A> " & vbCrLf)
end if
Response.Write(" 页次:" & page & "/" & pageCount & "页" & vbCrLf)
Response.Write(" 共有" & iCount & "条新闻" & vbCrLf)
Response.Write(" 转到" & "<INPUT CLASS=wenbenkuang TYEP=TEXT NAME=page SIZE=2 Maxlength=5 VALUE=" & page & ">" & "页" & vbCrLf & "<INPUT CLASS=go-wenbenkuang type=submit value=GO>")
Response.Write("</TD>" & vbCrLf )
Response.Write("</TR></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%></div></th>
</tr>
</table>
<table width="500" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
</div></td>
</tr>
</table>
上面的代码已调试成功,不过每行是显示两个图片了,可是显示的图片是同样的,标注<%这里好像有代码%>的地方我估计要加什么代码,可小弟搞不出来,请高手吗?帮帮忙啊~~~