[請益] 網頁嵌入播放器無法播放

看板PHP作者 (Zohan)時間13年前 (2012/04/26 02:58), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
程式碼如下 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $showForm = 1; if(isset($_POST['Submit'])) { $showForm = 0; ?> <OBJECT ID="MediaPlayer" WIDTH=320 HEIGHT=42 CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject"> <PARAM NAME="<?php $file ?>FileName" VALUE="<?php "'$path'" . "'$file'"?>"> <EMBED TYPE="application/x-mplayer2" SRC="<?php "'$path' . '$file'" ?>" NAME="MediaPlayer" WIDTH=320 HEIGHT=42> </EMBED> <?php } if ($showForm == 1) { //define the path as relative $path = "C:\AppServ\www\mp3"; //using the opendir function $dir_handle = @opendir($path) or die("Unable to open $path"); echo "Directory Listing of $path<br/>"; //running the while loop echo"<select>"; while ($file = readdir($dir_handle)) { if($file!="." && $file!="..") echo " <option value='$file'>$file</option>"; } echo"</select>"; //closing the directory closedir($dir_handle); echo "<form action='".$_SERVER['php_self']."' method='post' >"; $_POST[$file]; echo" <button type=\"submit\" name=\"Submit\" value=\"0\">Push Me</button>"; echo" <input type=\"submit\" />"; echo"</form>"; } ?> </body> </html> 試了又試... 在搜尋本機資料夾有哪些檔案的時候明明就找的到 但是卻無法播放 不知道是哪裡出了問題... 請給我一些意見 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 120.101.10.147

04/26 21:23, , 1F
<?php $var ?> 忘了加echo
04/26 21:23, 1F
文章代碼(AID): #1Fc4bQvh (PHP)
文章代碼(AID): #1Fc4bQvh (PHP)