Hello,
I wish to create a dynamic asx file which lists all the mp3 files in a directory…
This is then used in a html file as the source of an “<embed>” tag…
The html file does not open the asx playlist at all and I dont know what the problem is…. I have altered my http.conf file to add .asx as a php extension..
Here is the content of my asx files
Thanks
[code=php]<?php
header(“Content-Type: video/x-ms-asf;”);
// setting the directory to search for mp3 files
// reading the directory and inserting the mp3 files in the playlist array
$playlist = array();
$fdir = scandir(‘.’);
foreach($fdir as $i){
// if a .mp3 string is found, add the file to the array
if (strpos(strtolower($i),”.mp3″) !== false){
$playlist[] = $i;}
#sort() or shuffle()
}
echo “<asx version=”3.0″>”;
foreach($playlist as $i){
echo “<ENTRY>n”;
echo “<REF HREF=http://localhost/music/”.$i.” />n”;
echo “</ENTRY>nn”;
}
echo “</asx>”
?>