if (!$texts){$texts = toFixLen1($swfrow['info_subject'],40);} else{$texts = $texts."|".toFixLen1($swfrow['info_subject'],40);} } ?>
<script type="text/javascript"><!--var focus_width = 418; var focus_height = 240; var text_height = 20; var swf_height = focus_height+text_height; var pics = "<?=$pics?>"; var links = "<?=$links?>"; var texts = "<?=$texts?>";
除非$swfrow["info_id"]上面有问题
$var=$swfrow["info_id"];
$links = "show.php?id='$var'&unit_id='$unit_id'"; [/code]
$links = "show.php?id=".urlencode($swfrow["info_id"])."&unit_id=".$unit_id;
关键是我要做一个和www.csdn.net首页右边的动态图片切换的功能,那个是要用到FALSH的,
我现在怀疑是不是FALSH代码中不支持“&”所以导致了我的后面的参数不能正常传递,下面是我的全部代码,请大家帮忙分析一下,谢谢
$swfsql = "select * from table".$unit_id." where pic_url<>'' order by info_id desc LIMIT 0,8";
$swfres = mysql_query($swfsql);
$i = 0;
while($swfrow=mysql_fetch_array($swfres)){
$i += 1;
if (!$pics){$pics = $swfrow['pic_url'];} else{$pics = $pics."|".$swfrow['pic_url'];}
if (!$links){
$links = "show.php?id=".$swfrow["info_id"]."&unit_id=".$unit_id;
} else{
$links = $links."|show.php?id=".$swfrow["info_id"]."&unit_id=".$unit_id;
}
if (!$texts){$texts = toFixLen1($swfrow['info_subject'],40);} else{$texts = $texts."|".toFixLen1($swfrow['info_subject'],40);}
}
?>
<script type="text/javascript"><!--var focus_width = 418;
var focus_height = 240;
var text_height = 20;
var swf_height = focus_height+text_height;
var pics = "<?=$pics?>";
var links = "<?=$links?>";
var texts = "<?=$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="images/web1/pix.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
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://pic.zol.com.cn/pix.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
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="images/web1/pix.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
//-->
</script>
document.write('<embed src="images/web1/pix.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
比如show.php?p=14--001,这样传过去,在show.php获得$_GET['p']再以--切分,默认 第一个就是id参数值,第二个就是unit_id参数值,这个可以自己指定.