Player con creazione PlayList automatica con uso di php

Senza uso di file XML gli mp3 inseriti nella cartella "mp3"
saranno prelevati automaticamente dal Player
Sorgente: http://www.gchats.com/products/



<?php
header("Expires:-1");
header("Pragma: no-cache");
header("Cache-Control:no-cache, must-revalidate");
$dir = "mp3";
$song =1;
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
if($filename!== "." && $filename!== ".."){
print("&song".$song."=".$filename); 
$path_parts = pathinfo($filename);
$extionsion = strlen($path_parts["extension"]);
$basename = substr($path_parts["basename"], 0,(strlen($path_parts["basename"])-$extionsion-1));
print("&base".$song."=".$basename);
$song=$song+1;
}
}
print("&songs=".($song-1)."&result=loaded"); 
?> 




<%
Response.Expires = -1
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "Cache-Control", "no-cache, must-revalidate"
songs = 1
set fs = server.createobject("scripting.filesystemobject")
set fo = fs.getfolder(server.mappath("mp3"))
for each i in fo.files
response.write ("&song" & songs & "=" & i.name)

response.Write("&base" & songs & "=" & fs.GetBaseName(i.name))
songs = songs +1
next
response.write("&songs=" & songs-1 & "&result=loaded")
set fo = nothing
set fs = nothing
%>