急求ASP程序改成随即显示文章代码
<linkhref="css/bjs.css"rel="stylesheet"type="text/css"/><scriptlanguage="JavaScript"t...
<link href="css/bjs.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript">
var Zyads_tan=new Array();
Zyads_tan['name']="zdygh2008";
Zyads_tan['adid']="50";
Zyads_tan['lun']="0";
Zyads_tan['poptype']="1";
Zyads_tan['poptime']="0";
</script>
<% dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * from news where type_one_id=1 order by num desc"
rs.open sql,conn,1,1
%>
<%i=0
do while not rs.eof%>
<tr>
<td width="8%" align="center" background="img/hang22.gif"><img src="img/aire2.gif" width="2" height="2" /></td>
<td width="60%" height="20" class="bottext12s" background="img/hang22.gif"><a href="newsdaile.asp?id=<%=rs("id")%>" target="_blank" class="tya"><%=left(rs("title"),9)%>...</a></td>
<td width="32%" height="20" align="center" background="img/hang22.gif" class="bottext12s"><%=rs("writetime")%></td>
</tr>
<%rs.movenext
i=i+1
if i=5 then exit do
loop
rs.close %>
我想把这个改为随机显示5篇文章怎么修改,重酬 展开
<script language="JavaScript" type="text/javascript">
var Zyads_tan=new Array();
Zyads_tan['name']="zdygh2008";
Zyads_tan['adid']="50";
Zyads_tan['lun']="0";
Zyads_tan['poptype']="1";
Zyads_tan['poptime']="0";
</script>
<% dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * from news where type_one_id=1 order by num desc"
rs.open sql,conn,1,1
%>
<%i=0
do while not rs.eof%>
<tr>
<td width="8%" align="center" background="img/hang22.gif"><img src="img/aire2.gif" width="2" height="2" /></td>
<td width="60%" height="20" class="bottext12s" background="img/hang22.gif"><a href="newsdaile.asp?id=<%=rs("id")%>" target="_blank" class="tya"><%=left(rs("title"),9)%>...</a></td>
<td width="32%" height="20" align="center" background="img/hang22.gif" class="bottext12s"><%=rs("writetime")%></td>
</tr>
<%rs.movenext
i=i+1
if i=5 then exit do
loop
rs.close %>
我想把这个改为随机显示5篇文章怎么修改,重酬 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询