图片排列问题,附原代码
如下列是库中某一字段。横线表示是图片的路径
_
_
_
_
我想叫它这样排列并能分页,随有一个可行的办法,谢了。
_ _ _ _ _
_ _ _ _ _
_ _ _ _ _
<%
case "small"
anclassid=request("anid")
if not isnumeric(anclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(anclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
nclassid=request("nid")
if not isnumeric(nclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(nclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_anclass where anclassid="&anclassid,conn,1,1
anclassname=rs("anclass")
rs.close
rs.open "select * from shop_nclass where nclassid="&nclassid,conn,1,1
nclassname=rs("nclass")
rs.close
%>
<tr>
<td height=61 valign="top"> </td>
</tr>
<%
end if
end if
end if
end if
case "tejia"%>
<%case "hot"%>
<%case "news"%>
<%case else%>
<%end select%>
</table>
<%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
%>
<table width="370" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td align=center>暂无商品</td>
</tr>
</table>
<%
else
rs.PageSize =5 '每页记录条数
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="96" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><%if rs("bookpic")="" then
response.write "<div align=center><a href=list.asp?id="&rs("bookid")&" ><img src=images/emptybook.gif width=100 height=100 border=0></a></div>"
else%>
<a href="list.asp?id=<%=rs("bookid")%>" ><img src="<%=trim(rs("bookpic"))%>" width="100" border="0" height="100" /></a>
<%end if%></td>
</tr>
</table>
<table width="96" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><%if rs("bookpic")="" then
response.write "<div align=center><a href=list.asp?id="&rs("bookid")&" ><img src=images/emptybook.gif width=100 height=100 border=0></a></div>"
else%>
<a href="list.asp?id=<%=rs("bookid")%>" ><img src="<%=trim(rs("bookpic"))%>" width="100" border="0" height="100" /></a>
<%end if%></td>
</tr>
</table>