Jump to content

updating jukebox


RaythMistwalker

Recommended Posts

<?php

$song = $_POST['song'];
$go = $_POST['go'];

if($go){
?>
<!-- Player Start -->
<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab" width="240" height="43">
<param name="FileName" value="songs/<? echo $song; ?>">
<param name="AutoStart" value="true">
<param name="ShowTracker" value="true">
<param name="ShowControls" value="true">
<param name="ShowGotoBar" value="false">
<param name="ShowDisplay" value="false">
<param name="ShowStatusBar" value="false">
<param name="AutoSize" value="false">
<param name="PlayCount" value="0">
<embed src="songs/<? echo $song; ?>" AutoStart="true" ShowTracker="true" ShowControls="true" PlayCount="0" ShowGotoBar="false" ShowDisplay="false" ShowStatusBar="false" AutoSize="false" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" width="240" height="43"></embed>
</object>
<!-- Player End -->
<?php
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>PHP jukebox</title>
</head>
<body>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<select name="song">
<option value="#">Choose a song</option>
<!-- List Files Start -->
<?
$files = Array();
$path = "songs";
$dh = opendir($path);
while ($file = readdir($dh)) {
  if (!is_dir($path."/".$file)) {
   if (is_file($path."/".$file)) {
    if (($file!=".") && ($file!="..")) {
     $files[] = $file;
    }
   }
  }
}
closedir($dh);

asort($files);
foreach($files as $index=>$file) {
  echo "<option value=\"".$file."\">".$file."</option>\n";
}
?>
<!-- List Songs End -->
</select>
<input name="go" type="submit" value="PLAY!">
</form>
</body>
</html>

 

Riiiight this is a jukebox code and it does display the files.. but it doesnt play the songs :o

 

im struggling to work out why as i'm getting no errors or anythin :/

Link to comment
https://forums.phpfreaks.com/topic/187857-updating-jukebox/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.