100分请教一个问题。
我在修改一个程序,他是图片程序一个专集里有几十张图片。我想实现左右按键跳到下一页的功能不知该如何写。文件代码如下:
<!--#include file="../conn.asp" -->
<!--#include file="../inc/config.asp" -->
<html>
<head>
<%
dim classid,classname,typeid,typename
if Request.QueryString("page")="" then
page=1
else
page=Request.QueryString("page")
end if
if IsNumeric(Request.QueryString("id"))=False then
Response.Redirect"info.asp?info=错误的参数"
else
id=cint(Request.QueryString("id"))
end if
set temprs=conn.execute("select typeid,classid,name from comicet_comic where id="&id)
typeid=temprs(0)
classid=temprs(1)
filename=temprs(2)
set temprs=nothing
set temprs=conn.execute("select name from comicet_class where id="&classid)
classname=temprs(0)
set temprs=nothing
set temprs=conn.execute("select name from comicet_type where id="&typeid)
typename=temprs(0)
set temprs=nothing
%>
<title><%=title%> >> <%=desktoptitle%> >> <%=classname%> >> <%=typename%> >> <%=filename%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
a { font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>; text-decoration: none}
a:hover { font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>; text-decoration: underline}
td { font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>}
br { font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>}
.bk { font-size: 9pt; border: 1px <%=xcolor%> solid}
body { font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none}
.an { font-family: "宋体"; font-size: 9pt; background-color: <%=bgcolor%>; border: 1px <%=xcolor%> solid; color: <%=fontcolor%>}
.xzy { border: <%=xcolor%> solid; border-width: 0px 1px 1px}
.zx { border: <%=xcolor%> solid; border-width: 0px 0px 1px 1px}
.sxz { border: <%=xcolor%> solid; border-width: 1px 0px 1px 1px}
.s { border: <%=xcolor%>; border-style: solid; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px}
.y { border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px}
.font { font-family: "Arial Black"; font-size: 14pt; color: <%=fontcolor%>}
.x { border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px}
.z { border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 1px}
.sx { border: <%=xcolor%>; border-style: solid; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px}
-->
</style>
</head>
<body bgcolor="<%=bgcolor%>" text="#000000">
<div align="center">
<table width="750" border="0" cellspacing="0" cellpadding="2" class="zx">
<tr>
<td class="s">
<table width="22" border="0" cellspacing="2" cellpadding="0">
<tr bgcolor="<%=titlecolor%>">
<td width="8" height="8"></td>
<td width="8" height="8"></td>
</tr>
<tr bgcolor="<%=titlecolor%>">
<td width="8" height="8"></td>
<td width="8" height="8"></td>
</tr>
</table>
</td>
<td width="724" valign="middle" class="font">漫画欣赏</td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0" class="xzy">
<tr>
<td colspan="2"><img src="../images/logo.jpg" width="247" height="85"></td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="3" class="xzy" height="25">
<tr>
<td bgcolor="<%=titlecolor%>"> 站内导航:<a href="index.asp">返回首页</a>
<%
sql = "SELECT * FROM comicet_class ORDER BY id DESC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,Conn,0,1
if rs.eof and rs.bof then
Response.Write"还没有分类"
else
do while not rs.eof
Response.Write"| <a href='class.asp?classid="&rs("id")&"'>"&rs("name")&"</a>"
rs.movenext
loop
end if
rs.close
Set rs=Nothing
%>
</td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="3" class="xzy">
<tr>
<td><%Response.Write "您当前的位置:<a href='"&homeurl&"'>"&title&"</a> - <a href='index.asp'>"&desktoptitle&"</a> - <a href='class.asp?classid="&classid&"'>"&classname&"</a> - <a href='type.asp?typeid="&typeid&"'>"&typename&"</a> - "&filename%></td>
</tr>
</table>
<div align="center">
<table width="750" border="0" align="center" cellspacing="0">
<tr>
<td align="center" valign="middle"><div align="center">
<%
sql = "SELECT * FROM comicet_comic where id="&id
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,Conn,1,1
onlinepic=split(rs("pic"),chr(13))
pagecoun=UBound(onlinepic)
Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='5'><tr><td>"
if rs("pic")="" then
Response.Write"没 有 提 供 在 线 浏 览"
else
Response.Write"<table width='100%' height='10' border='0' cellspacing='0' cellpadding='5'><tr><td align='right' height='10'>[当前:"&page&" | 共:"&pagecoun&"] </td></tr><tr><td width='750' align='center'>"
Response.Write"</td></tr></table><br><table width='750' border='0' align='center' cellspacing='0'><tr><td width='100%' align='center'><img src='"&onlinepic(page-1)&"'></td></table><br><table width='750' align='center'><tr><td width='308'><div align='right'><a href='display.asp?id="&id&"&page="&page-1&"'>上一页</a></div><td width='126'><div align='center'>回目录</div><td><td width='310'><a href='display.asp?id="&id&"&page="&page+1&"'>下一页</a></td></tr></table><br>[当前:"&page&" | 共:"&pagecoun&"]"
end if
Response.Write"</td></tr></table>"
Response.Write"<table width='750' border='0' cellspacing='0' cellpadding='3' class='bk'><tr><td width='720'>名称:"&rs("name")&" | 添加时间:"&rs("addtime")&"</td>"
if rs("down")<>"" then
Response.Write"<td width='30' class='z'><a href='"&rs("url")&"'>打 包<br>下 载</a> ["&rs("dx")&"]"
end if
Response.Write"</tr></table>"
rs.close
Set rs=Nothing
conn.close
Set conn=Nothing
%>
</div></td>
</tr>
</table>
</div>
<table width="750" border="0" cellspacing="0" cellpadding="3" class="xzy" height="25">
<tr>
<td colspan="2" bgcolor="<%=titlecolor%>" align="center"><%=cy%></td>
</tr>
</table>
</div>
</body>
</html>