1
我想在我的Facebook應用程序,但下面的代碼顯示隨機觀看YouTube視頻並沒有什麼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>
適合我。只需刪除''<?php'標籤就可以了'echo' –
@ShankarDamodaran它有$ video [$ num]所以不能是html –