Hi,
Im following a tutorial for a Flash mp3 player. The script assumes that you are building a dynamic song list. Any files within the song list folder would be included. Here is the code:
<?php
$handle=opendir("./");
$n = 0;
while (false !== ($file = readdir($handle)))
{
$ext = strtolower(strstr($file, '.'));
if ($ext == ".mp3")
{
echo "&file$n=$file";
$n++;
}
}
echo("&\n");
closedir($handle);
?>
For my situation, I do not need a dynamic playlist. I will only be loading one song when the page loads, and the path is stored in a mysql DB. I can use:
SELECT mp3_path from songs where songid=1
to return
/mp3/Song Title.mp3
So how could I change the above posted code to just use that path instead of using an array for a dynamic playlist? Also, how could I make sure the variable is ready for Flash to receive? Do I use an ampersand?
Thanks for any help.