急
本人做的一个网站,其中一个页面调用另外的asp文件里的函数正常,但在主页面调用该函数则提示该函数为定义,请各位帮忙啊~~~~~~~~
函数定义代码如下
sub video_new_hot(n_jt,nnhead,nmore,nsql,nt,n_num,n_m,c_num,et,tt,tupian)
dim di,temp1,tim,counter,nhead:nhead=nnhead
if n_jt<>"" then n_jt="<img src=""images/PIC/JT0.GIF"" width=""8"" height=""8"" border=0>"
temp1=vbcrlf&"<table border=0 width='100%' cellspacing=0 cellpadding=2 class=tf>"
sql="select top "&n_num+n_m&" id,type,title,username,tim,counter,pic,lang,power,remark,hot,emoney from video where hidden=1"&nsql
select case nt
case "hot"
sql=sql&" order by counter desc,id desc"
if nhead="" then nhead="观看排行"
case "good"
sql=sql&" and hot=5 order by id desc"
if nhead="" then nhead="影片推荐"
case else
sql=sql&" order by id desc"
if nhead="" then nhead="影片更新"
end select
set rs=conn.execute(sql)
for di=1 to n_m
if rs.eof or rs.bof then exit for
rs.movenext
next
'if n_m>0 then rs.move(n_m)
'是否为图片排行
if tupian="tu" then
do while not rs.eof
name=rs("title"):tim=rs("tim"):counter=rs("counter"):movie=rs("type"):emoney=rs("emoney"):power=rs("power")
dim emoney,power
'网上图片判断
call video_movie(movie)
temp1=temp1&vbcrlf&"<tr><td class=bw width=140><TABLE border=0><TR><TD><img src='"&rs("pic")&"' border=0 width=100 height=80></TD></TR><TR><TD align=middle height=25><a href='video_view.asp?id="&rs("id")&"'"&atb&"><img src=images/video/small_play.gif border=0><img src=images/video/small_view.gif border=0></a> </TD></TR></TABLE></td><td >"
temp1=temp1&"<TABLE border=0 cellPadding=2 cellSpacing=0 ><TR><TD>片名:<a href='video_view.asp?id="&rs("id")&"'"&atb&">"&rs("title")&"</A></TD></TR><TR><TD valign=bottom>语种:"&rs("lang")&" "&movie&" </TD></TR><TR><TD>星级:<img src='images/down/star_"&rs("hot")&".gif' border=0> 人气:<FONT class=red_3>"&rs("counter")&"</FONT></TD></TR><TR><TD><FONT class=red_3>"&power_pic(emoney,power,1)&"</FONT></TD></TR><TR><TD>介绍:"&code_html(rs("remark"),2,40)&"</TD></TR></TABLE><tr><td colspan=2><TABLE border=0 cellPadding=2 cellSpacing=0 width='96%'><TBODY><TR><TD background=images/bg_dian.gif height=1 border=0></TD></TR></TBODY></TABLE>"
temp1=temp1&"</td></tr>"
rs.movenext
loop
else
do while not rs.eof
name=rs("title"):tim=rs("tim"):counter=rs("counter")
temp1=temp1&vbcrlf&"<tr><td width='30%'> <img src='"&rs("pic")&"' border=0 width=50 height=40></td><td class=bw width='70%'>"&n_jt&"<a href='video_view.asp?id="&rs("id")&"'"&atb&" title='名称:"&code_html(name,1,0)&"<br>发 布 人:"&rs("username")&"<br>观看人次:"&counter&"<br>整理时间:"&time_type(tim,88)&"'>"&code_html(name,1,c_num)&"</a>"
if tt>0 then temp1=temp1&format_end(et,time_type(tim,tt)&",<font class=blue>"&counter&"</font>")
temp1=temp1&"</td></tr>"
rs.movenext
loop
end if
rs.close
temp1=temp1&vbcrlf&"</table>"
response.write kong&temp1
end sub
调用时候
<TR>
<TD colSpan=3 height=100 vAlign=top><table width="100%" border="0">
<tr>
<td><%call main_video()%></td>
</tr>
</table></TD>
</TR>
问题点数:0、回复次数:8Top
1 楼TrueAndFalse(彩旗飘飘)回复于 2004-05-03 02:24:10 得分 0
main_video 函数在哪里?Top
2 楼leon8071(小葛)回复于 2004-05-03 02:27:57 得分 0
sub main_video()
dim w_h:w_h=" width=120 height=90"
%>
<table border=0 width='98%' cellspacing=0 cellpadding=0><tr><td height=5></td></tr><tr valign=top><%
sql="select top 4 id,title,pic from video where hidden=1 order by tim desc,id desc"
set rs=conn.execute(sql)
do while not rs.eof
response.write vbcrlf&"<td width='33%' align=center><a href=""video_view.asp?id="&rs("id")&"""><img src="""&rs("pic")&""" border=0"&w_h&"><br>"&rs("title")&"</a></td>"
rs.movenext
loop
rs.close
%></tr></table>
<%
end sub
大哥帮忙啊.小弟等~~~~~Top
3 楼leon8071(小葛)回复于 2004-05-03 02:31:46 得分 0
我调用video_new_hot就显示变量未定义Top
4 楼TrueAndFalse(彩旗飘飘)回复于 2004-05-03 02:36:58 得分 0
你在调用这些 SUB 的页面中要把他们包含进来Top
5 楼leon8071(小葛)回复于 2004-05-03 02:49:34 得分 0
video_new_hot这个函数是在lib_bideo.asp里定义的,如果说我想在main.asp里调用video_new_hot这个函数,那在文件头就应该加<!-- #include file="inc/lib_video.asp" -->
这个语句,把lib_video.asp包含进来,是这样的吧.
Top
6 楼TrueAndFalse(彩旗飘飘)回复于 2004-05-03 04:14:10 得分 0
对Top
7 楼Drowning(悠長假期~~)回复于 2004-05-03 05:06:06 得分 0
nodTop
8 楼liuyangxuan(阿轩)回复于 2004-05-03 09:30:17 得分 0
过程!Top




