| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 474 人关注过本帖
标题:不同语句的链接
只看楼主 加入收藏
酷酷的鱼
Rank: 1
等 级:新手上路
威 望:1
帖 子:472
专家分:0
注 册:2005-8-9
收藏
 问题点数:0 回复次数:3 
不同语句的链接
<!--焦点图开始-->
<SCRIPT type=text/javascript>
<!--

var focus_width=240
var focus_height=150
var text_height=0
var swf_height = focus_height+text_height

var pics='http://image2.sina.com.cn/ent/U1431P28T140D1F2892DT20060220235413.jpg|http://image2.sina.com.cn/ent/U92P28T140D1F2896DT20060220121356.jpg|http://image2.sina.com.cn/ent/U1431P28T140D1F2894DT20060220221939.jpg|http://image2.sina.com.cn/ent/U1431P28T140D1F2826DT20060220221939.jpg|http://image2.sina.com.cn/ent/U1326P28T140D1F2890DT20060221071719.JPG'
var links='http://ent.sina.com.cn/f/y/tysgcanada/index.shtml|http://ent.sina.com.cn/m/f/2006-02-20/1145990999.html|http://ent.sina.com.cn/y/2006-02-20/ba991422.shtml|http://ent.sina.com.cn/y/2006-02-20/ba991105.shtml|http://ent.sina.com.cn/h/2006-02-20/ba991532.shtml'
var texts='||||'

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="image/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed src="http://image2.sina.com.cn/bj/zonghe/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');

//-->
</SCRIPT>
<!--焦点图结束-->
这段程序中的pics是图片地址,links是页面地址,各有五个
如何把他们同<%Set rs = Server.CreateObject("ADODB.Recordset")
strsql="SELECT top 7 * FROM news where newsclass='4' or newsclass='5' or newsclass='6' or newsclass='7' or newsclass='8' or newsclass='9' or newsclass='10' or newsclass='11' or newsclass='12' or newsclass='13' or newsclass='14' or newsclass='15' ORDER BY newsid desc"
rs.Open strsql,conn,1
%>这种语句链接起来
搜索更多相关主题的帖子: 语句 链接 
2006-02-21 10:59
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 
<%Set rs = Server.CreateObject("ADODB.Recordset")
strsql="SELECT top 7 * FROM news where newsclass='4' or newsclass='5' or newsclass='6' or newsclass='7' or newsclass='8' or newsclass='9' or newsclass='10' or newsclass='11' or newsclass='12' or newsclass='13' or newsclass='14' or newsclass='15' ORDER BY newsid desc"
rs.Open strsql,conn,1
%>

这句可以写成这样:

<%
Set rs = Server.CreateObject("ADODB.Recordset") strsql="SELECT top 7 * FROM news where newsclass>='4' and newsclass<='15' ORDER BY newsid desc"
rs.Open strsql,conn,1
%>
搞那么长,不晕啊!!

[此贴子已经被作者于2006-2-21 11:08:33编辑过]


专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2006-02-21 11:08
酷酷的鱼
Rank: 1
等 级:新手上路
威 望:1
帖 子:472
专家分:0
注 册:2005-8-9
收藏
得分:0 

谢谢,不过我想问的是上面那段是javascript语言
其中的pics是图片地址,五条,links是图片页面地址
我想实现他们的地址从数据库中读出,怎么办


2006-02-21 11:24
酷酷的鱼
Rank: 1
等 级:新手上路
威 望:1
帖 子:472
专家分:0
注 册:2005-8-9
收藏
得分:0 

<!--#include file="opendb.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%Set rs = Server.CreateObject("ADODB.Recordset")
strsql="SELECT top 5 * FROM news where newsclass ='20' ORDER BY newsid desc"
rs.Open strsql,conn,1
dim p(4)
dim l(4)
dim pic1
dim link1
for i=0 to 4
'if not rs.eof then
p(i)="http://www.zznet.com.cn/"&rs("img")
l(i)="http://www.zznet.com.cn/new-zznet/news/inagesnew.asp?id="&rs("newsid")
'end if
'rs.movenext
next
rs.close

pic1="'"&p(0)&"|"&p(1)&"|"&p(2)&"|"&p(3)&"|"&p(4)&"'"
link1="'"&l(0)&"|"&l(1)&"|"&l(2)&"|"&l(3)&"|"&l(4)&"'"
call jdt(pic1,link1)%>

<!--焦点图开始-->
<SCRIPT type=text/javascript>
<!--
function jdt(pic1,link1) {
var focus_width=240
var focus_height=150
var text_height=0
var swf_height = focus_height+text_height

var pics=pic1
var links=link1
var texts='||||'

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="image/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed src="http://image2.sina.com.cn/bj/zonghe/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');
}
//-->
</SCRIPT>
<!--焦点图结束-->
</body>
</html>

系统提示页面有问题,其中字段名,表名都无误,表中有内容,请问有什么错误,如何改正


2006-02-21 13:06
快速回复:不同语句的链接
数据加载中...
 
   



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

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