Post by RobiWanKen0bi on Jun 16, 2010 11:40:38 GMT -8
Hi. A friend told me that I should post this request here. I need a small change in this code.
Now I already know I need to change the $nameofdir variable equal to the name of the folder where my music resides to make this work for a website. But it doesn't work for a Proboards forum, 'cos it doesn't have a music/ directory.
How do I make it work like: "www.mynonproboardswebsitename.com/music/" instead of just "music/"?
Now I already know I need to change the $nameofdir variable equal to the name of the folder where my music resides to make this work for a website. But it doesn't work for a Proboards forum, 'cos it doesn't have a music/ directory.
How do I make it work like: "www.mynonproboardswebsitename.com/music/" instead of just "music/"?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript"><!--
function song(){
document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+document.getElementById('cancion').value+"' name='MediaPlayer1' width='300' height='75' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true'></embed>";
}
//-->
</script>
</head>
<body>
<select id="cancion" onchange="song()" size="1">
<option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
<?php
$nameofdir = "music/";
$domain = $_SERVER['HTTP_HOST'];
$dir = opendir($nameofdir);
while (($file = readdir($dir)) !== false)
{
if (strpos($file, '.mp3') !== false) {
$name = str_replace('.mp3', ' ', $file);
$files = str_replace(" ", "%20", $file);
echo '<option value="http://'.$domain.'/'.$nameofdir.''.$file.'">'.$name.'</option>'."\n"; }
}
?>
</select><br>
<span id="music1"><embed type="application/x-mplayer2" id="music1"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
src=""
name="MediaPlayer1"
width="300"
height="70"
controltype="2"
showcontrols="1"
showstatusbar="1"
AutoStart="0">
</embed></span>
</div>
</body>
</html>