【发布时间】:2014-01-22 15:41:11
【问题描述】:
我想在我的 Facebook 应用上随机观看 YouTube 视频,但代码显示如下,但没有任何内容
我的代码:
<?php
$num=rand(0,2);
$video=array("Z0xfWCDLoCU","vv7EtBmZ-ko","Lh3TokLzzmw");
?>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>Таны өнөөдрийн сонсох дуу</title>
</head>
<center>
<body background="assets/1.jpg" >
</br>
<p style="font-size:30px"><?php echo $user_profile['name']; ?> Your song of the day </p>
</br>
</br>
<p style="font-size:50px;color:#a7a7a7;"><?php echo $songs[$num]; ?> </p>
<?php echo "<iframe width=\"560\" height=\"315\" src=\"http://www.youtube.com/embed/$video[$num]\" frameborder=\"0\" ></iframe>"; ?>
</body>
</center>
</html>
结果是
<iframe width="560" height="315" src="http://www.youtube.com/embed/0k_1kvDh2UA" frameborder="0"></iframe>
#document
<html>
<head></head>
<body></body>
</html>
</iframe>
【问题讨论】:
-
对我来说很好。只需删除
echo周围的<?php标签 -
@ShankarDamodaran 它有 $video[$num] 所以不能是 html
标签: php facebook iframe youtube