100分请教一个问题。

langya001 2004-09-07 11:32:59
我在修改一个程序,他是图片程序一个专集里有几十张图片。我想实现左右按键跳到下一页的功能不知该如何写。文件代码如下:
<!--#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>
...全文
115 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
.....头晕中......
理一下思路先。。。。
楼主贴的代码太长了。。。
langya001 2004-09-07
  • 打赏
  • 举报
回复
头晕中。。。多谢各位。。唉。。。功力不够。。没用过JS。。唉
yuziyu 2004-09-07
  • 打赏
  • 举报
回复
WEB讨论组群:5785453 欢迎网页技术和FLASH爱好者莅临本群,我们共同进步,风雨同行。
DIY 俱乐部 5773956 欢迎硬件爱好者光临
tutu944 2004-09-07
  • 打赏
  • 举报
回复
关注! xiaoyuehen(散了吧认了吧算了吧放了吧)应该可以吧~不知道有没有JS高手写过~
ycted 2004-09-07
  • 打赏
  • 举报
回复
用onclick调用location='type.asp?key=<%="&key&"%>&page=<%"&ipagecurrent-1&"%>'"
xiaoyuehen 2004-09-07
  • 打赏
  • 举报
回复
思路: 用js捕捉用户的按键..结合location属性...捕捉代码我就不会了.
guoweidong 2004-09-07
  • 打赏
  • 举报
回复
就是分页啊. s1ihome(I Believe I Can Fly) 已经给你一个分页的例子了.
langya001 2004-09-07
  • 打赏
  • 举报
回复
5400
我有点看不懂你的代码。input?你是想让我做什么呀?能说下思路吗?谢谢
5400 2004-09-07
  • 打赏
  • 举报
回复
<input onClick="javascript:window.open('shopping.asp?id=<%=rs("bookid")%> ','','width=650,height=450,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;" type="image" border="0" name="submit23" src="images/gm.gif" width="56" height="23">

这样子不错
langya001 2004-09-07
  • 打赏
  • 举报
回复
搜索页面的代码:
改图片?有什么用??
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center" 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" align="center" 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="5" align="center" class="xzy" height="400">
<tr>
<td width="179" valign="top" class="y" align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<form name="form1" method="get" action="search.asp">
<tr>
<td width="63%">搜索文件 ↓</td>
<td width="37%" align="right">Search</td>
</tr>
<tr align="center">
<td colspan="2" class="s">
<input type="text" name="key" size="15" class="an">
<input type="submit" name="Submit" value="确定" class="an">
</td>
</tr>
</form>
</table>
<%
'------推荐壁纸------

Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='3'><tr><td width='61%'>本站推荐壁纸 ↓</td><td align='right' width='39%'>HOT PIC</td></tr><tr><td align='center' class='s' colspan='2'>"
sql = "SELECT minipic,id,name,ck FROM comicet_type where hot=1 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"没有被推荐的连载<br><br></td></tr>"
else
Response.Write"<a href='type.asp?typeid="&rs("id")&"' target='_blank'><img src='"&rs("minipic")&"' border='0' class='bk'></a></td></tr><tr><td colspan='2' align='center'><a href='?id="&rs("id")&"' target='_blank'>"&rs("name")&"</a> | 察看:"&rs("ck")&"<br><br></td></tr>"
end if
rs.close
Set rs=Nothing
Response.Write"</table>"

'------壁纸浏览排行------

Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='3'><tr><td width='56%'>壁纸浏览排行 ↓</td><td align='right' width='44%'>TOP 10</td></tr><tr><td colspan='2' height='1' bgcolor='"&xcolor&"'></td></tr>"
dim top
top=0
sql = "SELECT name,ck,id FROM comicet_type ORDER BY ck DESC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,Conn,0,1
if rs.eof and rs.bof then
Response.Write"<tr><td colspan='2' align='center'>还 没 有 任 何 连 载</td></tr>"
else
do while not rs.eof
Response.Write"<tr><td colspan='2'><a href='type.asp?typeid="&rs("id")&"' target='_blank'>"&rs("name")&"</a> | 察看:"&rs("ck")&"</td></tr>"
rs.movenext
top=top+1
if top=10 then exit do
loop
end if
rs.close
Set rs=Nothing
Response.Write"<tr><td colspan='2' class='s'> </td></tr></table>"
%>
</td>
<td width="551" valign="top">
<%
Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='3' class='x'><tr><td>您当前的位置:<a href='"&homeurl&"'>"&title&"<a> - <a href='index.asp'>"&comictitle&"</a> - 搜索:"&key&"</td></tr></table>"
Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='5'>"
Dim ipagecount
Dim ipagecurrent
Dim strorderBy
Dim irecordsshown
if request.querystring("page")="" then
ipagecurrent=1
else
ipagecurrent=cint(request.querystring("page"))
end if
xms=33
sql = "SELECT name,id,minipic,outdate,ck FROM comicet_type where name like '%"&key&"%' ORDER BY id DESC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.pagesize = xms
rs.cachesize = xms
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'>没找到任何连载</tr></td>"
else
rs.absolutepage = ipagecurrent
irecordsshown = 0
do while irecordsshown<xms and NOT rs.EOF
Response.Write"<tr align='center'>"

for i=1 to 3
Response.Write"<td width='33%'>"
if not rs.eof then
Response.Write"<a href='type.asp?typeid="&rs("id")&"'><img src='"&rs("minipic")&"' border='0' class='bk'></a><br><br><a href='type.asp?typeid="&rs("id")&"'>"&rs("name")&"</a> | 察看:"&rs("ck")&"<br>最后更新:"&rs("outdate")&"</td>"
irecordsshown = irecordsshown +1
rs.movenext
end if
next

Response.Write"</tr>"
loop
end if
rs.Close
set rs=nothing
Response.Write"</table>"

Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='5' class='s'><tr><td height='20'>每页显示 9 个文件 共有 "&ipagecount&" 页 当前为第 "&ipagecurrent&" 页 "
if ipagecurrent=1 then
Response.Write"首页 | "
else
Response.Write"<a href='type.asp?typeid="&typeid&"&page=1'>首页</a> | "
end if
if ipagecurrent=1 then
Response.Write"上一页 | "
else
Response.Write"<a href='type.asp?key="&key&"&page="&ipagecurrent-1&"'>上一页</a> | "
end if
if ipagecount>ipagecurrent then
Response.Write"<a href='type.asp?key="&key&"&page="&ipagecurrent+1&"'>下一页</a> "
else
Response.Write"下一页"
end if
if ipagecount>ipagecurrent then
Response.Write"| <a href='type.asp?key="&key&"&page="&ipagecount&"'>末页</a> "
else
Response.Write"| 末页 "
end if
Response.Write"</td></tr></table>"
%>
</td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="3" align="center" class="xzy" height="25">
<tr>
<td colspan="2" bgcolor="<%=titlecolor%>" align="center"><%=cy%></td>
</tr>
</table>
</body>
</html>
  • 打赏
  • 举报
回复
搜索分页看看~

主要得修改这里,你可以把上一页下一页替换成左右按键的图片然后不就可以了吗

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&"]"
langya001 2004-09-07
  • 打赏
  • 举报
回复
呵呵。。详细点嘛

主要是偶不知截哪里好。所以就。。。嘿嘿

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧