问一个简单的问题 大家帮忙看看。
我做了一个分页的程序 但是不知道那里有问题 就是不能输出循环图片只能显示一张图片 请各位指点 代码如下:
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<%
cid=request("id")
if cid="" then
sql="select * from HN_pro where kinds=true order by id desc"
else
sql="select * from HN_pro where cstr(class)='"&cid&"' and kinds=true order by id desc"
end if
set rsnews=server.createobject("adodb.recordset")
rsnews.open sql,conn,1,1
if rsnews.eof then
Response.Write " <div align='center' class='font1'>暂无作品!</div></td></tr></table></td></tr></table>"
end if
'IF Not rsnews.eof Then
if not (rsnews.eof and rsnews.bof) then
proCount=rsnews.recordcount
rsnews.PageSize=8 '定义显示数目
if not IsEmpty(Request("ToPage")) then
ToPage=CInt(Request("ToPage"))
if ToPage>rsnews.PageCount then
rsnews.AbsolutePage=rsnews.PageCount
intCurPage=rsnews.PageCount
elseif ToPage<=0 then
rsnews.AbsolutePage=1
intCurPage=1
else
rsnews.AbsolutePage=ToPage
intCurPage=ToPage
end if
else
rsnews.AbsolutePage=1
intCurPage=1
end if
intCurPage=CInt(intCurPage)
k=0
do while Not rsnews.eof
'k=k+1
%>
<tr>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<%
cid=request("id")
if cid="" then
sql="select * from HN_pro where kinds=true order by id desc"
else
sql="select * from HN_pro where cstr(class)='"&cid&"' and kinds=true order by id desc"
end if
set rsnews=server.createobject("adodb.recordset")
rsnews.open sql,conn,1,1
if rsnews.eof then
Response.Write " <div align='center' class='font1'>暂无作品!</div></td></tr></table></td></tr></table>"
end if
'IF Not rsnews.eof Then
if not (rsnews.eof and rsnews.bof) then
proCount=rsnews.recordcount
rsnews.PageSize=8 '定义显示数目
if not IsEmpty(Request("ToPage")) then
ToPage=CInt(Request("ToPage"))
if ToPage>rsnews.PageCount then
rsnews.AbsolutePage=rsnews.PageCount
intCurPage=rsnews.PageCount
elseif ToPage<=0 then
rsnews.AbsolutePage=1
intCurPage=1
else
rsnews.AbsolutePage=ToPage
intCurPage=ToPage
end if
else
rsnews.AbsolutePage=1
intCurPage=1
end if
intCurPage=CInt(intCurPage)
k=0
do while Not rsnews.eof
'k=k+1
%>
<tr>
<td><table width="120" height="120" border="0" cellpadding="3" cellspacing="5">
<tr>
<td align="center"><a href="Product_view.asp?id=<%=rsnews("id")%>"><img src="<%=rsnews("come")%>" width="100" height="80" border="0"></a></td>
</tr>
<tr>
<td align="center"><a href="Product_view.asp?id=<%=rsnews("id")%>" class="font1">
<% = Left(rsnews("title"),10) %>
</a></td>
</tr>
</table></td>
<tr>
<td align="center"><a href="Product_view.asp?id=<%=rsnews("id")%>"><img src="<%=rsnews("come")%>" width="100" height="80" border="0"></a></td>
</tr>
<tr>
<td align="center"><a href="Product_view.asp?id=<%=rsnews("id")%>" class="font1">
<% = Left(rsnews("title"),10) %>
</a></td>
</tr>
</table></td>
</tr>
<%
rs.movenext
k=k+1
Loop
%>
</table>
<%
rs.movenext
k=k+1
Loop
%>
</table>