| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 663 人关注过本帖
标题:“上一张,下一张”应该怎么写啊?
只看楼主 加入收藏
我心再飞翔
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-2-5
收藏
 问题点数:0 回复次数:2 
“上一张,下一张”应该怎么写啊?

我想在这一页加个“上一张,下一张”应该怎么写啊,我是菜鸟,还请各位大哥帮忙!先谢了!

<!--#include file="conn.asp"-->
<!--#include file="web.asp"-->
<html>
<head>
<title><%=rs5("webname")%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style/css.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<meta http-equiv="Page-Enter" content="blendTrans(Duration=3.0,Transition=23)">
<meta http-equiv="Page-Exit" content="revealTrans(Duration=3.0,Transition=23)">
</head>
<body bgcolor="6c6c6c" leftmargin="0" topmargin="0">

<script language=javascript src="guanggao/ad.js"></script>
<!--#include file="top.asp"-->
<table width="762" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" valign="top"></td>
<td width="568" rowspan="2" align="center" valign="top"><table width="121%" border="0" cellpadding="0" cellspacing="0" background="img/dian.gif">
<tr>
<td width="510" height="420" align="center"><table width="121%">
<tr>
<td height="10" background="tu/fgx01.gif"></td>
</tr>
</table> <table width="174">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="90" align="left">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="320" height="420" cellpadding="0" cellspacing="0">
<tr bgcolor="#993300">
<td height="10" colspan="3"></td>
</tr>
<tr>
<td width="10" height="400" bgcolor="#993300">&nbsp;</td>
<td width="300"><img src="showimg_ywxm_01.asp?id=<%=request("id")%>" name="show" width="300" height="400" border="0"></td>
<td width="10" bgcolor="#993300">&nbsp;</td>
</tr>
<tr bgcolor="#993300">
<td height="10" colspan="3"></td>
</tr>
</table>
<table width="100">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<DIV class=dek id=dek>
<table style="width: 100px;border: 1 solid #000000" cellspacing="0" cellpadding="0" bgcolor="#FFFFE1">
<tr>
<td><table width="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100"><%=rs("title")%></td>
</tr>
</table></td>
</tr>
</table>
</DIV>
<SCRIPT language="" type=text/javascript>
Xoffset= 0; // modify these values to ...
Yoffset= 20; // change the popup position.
myImg= new Array()
myImg[1]="graphalt.gif"
var nav,old,iex=(document.all),yyy=-1000;
if(navigator.appName=="Netscape"){(document.layers)?nav=true:old=true;}
if(!old){
var skn=(nav)?document.dek:dek.style;
if(nav)document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=get_mouse;
}
function popup(i){
if(old){alert(msg);return;}
else{yyy=Yoffset;
if(nav){skn.document.write(content);skn.document.close();skn.visibility="visible"}
if(iex){skn.visibility="visible"}
}
}
function get_mouse(e){
var x=(nav)?e.pageX:event.x+document.body.scrollLeft;skn.left=x+Xoffset;
var y=(nav)?e.pageY:event.y+document.body.scrollTop;skn.top=y+yyy;
}
function kill(){
if(!old){yyy=-1000;skn.visibility="hidden";}
}
//-->
</SCRIPT> </td>
</tr>
<tr>
<td height="10" background="tu/fgx01.gif" bgcolor="#A45A1B"></td>
</tr>
<tr>
<td>
<table width="85%" border="0" cellspacing="0" cellpadding="0">
<%Dim ipagecount
Dim ipagecurrent
Dim strorderBy
Dim irecordsshown
if request.querystring("page")="" then
ipagecurrent=1
else
ipagecurrent=cint(request.querystring("page"))
end if
classname=request("classname")
if classname="" then
classname="all"
end if
if classname="all" then
sql = "SELECT * FROM imgbook_01 ORDER BY title asc"
else

sql= "select * from imgbook_01 where classname='"&ltrim(rtrim(request("classname")))&"' order by title asc"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
if request("page")="" then
rs.pagesize = 5
rs.cachesize = 5
MaxPage=5
else
rs.pagesize = 5
rs.cachesize = 5
MaxPage=5
end if
rs.open sql,conn,1,1
ipagecount = rs.pagecount
If ipagecurrent > ipagecount Then ipagecurrent = ipagecount
If ipagecurrent < 1 Then ipagecurrent = 1
if ipagecount=0 then
response.write "<tr><td align='center'>没有任何图片"&classname&"</td></tr>"
else
rs.absolutepage = ipagecurrent
irecordsshown = 0
do while irecordsshown<MaxPage and NOT rs.EOF
%>
<tr>
<%for i=1 to 8%>
<td width='20%' height="91" background="img/dian.gif"><table border='0' align="center" cellpadding='0' cellspacing='0' style='width: 72'>
<tr>
<td align='center' style='height: 72'>
<%if not rs.eof then
w=rs("width"):h=rs("height")
m=w/99:n=h/99
if w>=99 or h>=99 then
if m>n then
w1=99:h1=h/m
elseif m<n then
h1=99:w1=w/n
else
w1=99:h1=99
end if
else
w1=w:h1=h
end if%>

<a href="img_ywxm_01.asp?id=<%=rs("id")%>&title=<%=rs("title")%>"><img src="showimg_ywxm_01.asp?id=<%=rs("id")%>" alt="点击查看大图" width="55" height="70" border=0></a>
<%irecordsshown = irecordsshown +1
end if
%></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table></td>
<%rs.movenext%>
<%next%>
</tr>
<%loop%>
<%end if
rs.Close
set rs=nothing
%>
</table>
</div></td>
</tr>
</table>
<td width="1" rowspan="2" valign="top" bgcolor="#cccccc"></td>
</tr>
<tr>
<td width="1" valign="top" bgcolor="#CCCCCC"></td>
<td width="173" valign="top" background="image/page.jpg"><table width="100" height="60" align="center">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<!--#include file="zuo.asp"-->
<td width="1" valign="top" bgcolor="#CCCCCC"></td>
</tr>
</table>
<!--#include file="down.asp"-->
<div ID="floater" style="left: 967px; top: 197px">
<p align="center">
<%Set rs4=server.createobject("adodb.recordset")
rs4.open"Select Top 1 ID,title From photo Where ID<"&ID&" and classid="&classID&" Order By ID Desc",conn,1,1
If rs4.EOF Or rs4.BOF Then
PrvNextArticle="<img src='img/2arrow2.gif' border=0 width=31 height=31>"
Else
PrvNextArticle="<a href='display.asp?id=" & cstr(rs4("id")) & "' >"&"<img src='img/2arrow2.gif' border=0 width=31 height=31></a>"
End If

Set rs4=server.createobject("adodb.recordset")
rs4.open"Select Top 1 ID,title From photo Where ID>"&ID&" and classid="&classID&" Order By ID ASC",conn,1,1
If rs4.EOF Or rs4.BOF Then
PrvNextArticle=PrvNextArticle&"<br><img src='img/2arrow1.gif' border=0 width=31 height=31>"
Else
PrvNextArticle=PrvNextArticle&"<br><a href='display.asp?id=" & cstr(rs4("id")) & "' >"&"<img src='img/2arrow1.gif' border=0 width=31 height=31></a>"
End If
Set rs4=Nothing
Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='5' align='center'><tr><td align='center'></td>"
response.write PrvNextArticle
Response.Write"</tr></table>"
%>
</p>
</div>
</body>
</html>

搜索更多相关主题的帖子: web css text title 
2007-02-05 06:53
melack
Rank: 1
等 级:新手上路
帖 子:230
专家分:0
注 册:2006-9-27
收藏
得分:0 

比如在show.asp显示当前图片,此时该图就有一个ID,比如说是 22,
那么可以在show.asp中的
下一张图片中可以这样写
<a href="show.asp?id=<%set rs=conn.execute("select id from table where id<22")%>">下一张</a>
上一张图片中这样写
<a href="show.asp?id=<%ser rs=conn.execute("select id from table where id>22")%>">上一张</a>
你去试试


欢迎光临我的小站 晒晒网 www.
2007-02-13 15:34
linhong00
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2005-11-30
收藏
得分:0 

楼上好像不怎么可以哦
<%
sql= "select id from tabke where id<request("id") order by id desc"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.write "没有上一条了"
response.write "<a href='show.asp?id="&rs("id")&"'>"&rs("title")&"</a>"
end if
rs.close
set rs=nothing
%>
<%
sql= "select id from tabke where id>request("id") order by id asc"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.write "没有下一条了"
response.write "<a href='show.asp?id="&rs("id")&"'>"&rs("title")&"</a>"
end if
rs.close
set rs=nothing
%>

[此贴子已经被作者于2007-2-14 11:20:28编辑过]

2007-02-14 11:17
快速回复:“上一张,下一张”应该怎么写啊?
数据加载中...
 
   



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

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