fanfavorite
IS-IT--Management
I have a flash player that reads in an XML file:
This works fine, but when I try to work use a php file:
the drop down menu of the flash does not display, even though if you go to audioxml.php it displays fine. The songs still play through as in the XML file, but just doesn't load the playlist drop down correctly. In IE7, if I hit refresh, the menu displays fine (almost like it didn't finish loading the first time). In Firefox and other browsers, it just stays without the proper list in the drop down. The php file is like:
I have also tried:
Does anyone know why it would not be loading correctly? Is there a better way to create an XML file from dynamic MySQL data?
Thanks everyone.
This works fine, but when I try to work use a php file:
the drop down menu of the flash does not display, even though if you go to audioxml.php it displays fine. The songs still play through as in the XML file, but just doesn't load the playlist drop down correctly. In IE7, if I hit refresh, the menu displays fine (almost like it didn't finish loading the first time). In Firefox and other browsers, it just stays without the proper list in the drop down. The php file is like:
Code:
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
$url = "../../media/mp3/";
include('../includes/connection.php');
echo "\n<gallery>";
$CatArray[] = "0";
$count = 1;
$q = mysql_query("SELECT * FROM MusicPlayer ORDER BY Category");
while($f = mysql_fetch_array($q)) {
if (in_array($f[Category], $CatArray) == false) {
if ($count != 1) {
echo "\n\t</category>";
}
echo "\n\t";
echo '<category name="'.$f[Category].'">';
$CatArray[] = $f[Category];
}
$artist = strtoupper($f[Artist]);
$song = strtoupper($f[SongName]);
echo "\n\t\t";
echo '<item mp3Path="'.$url.$f[Filename].'" played="0"><![CDATA[<font face="Font" color="#198a56">'.$artist.': </font><font face="Font" color="#FFFFFF">'.$song.'</font>]]></item>';
$count++;
}
echo "\n\t</category>";
echo "\n</gallery>";
I have also tried:
Code:
<?
$url = "../../media/mp3/";
include('../includes/connection.php');
$doc = new DOMDocument();
$doc->formatOutput = true;
$r = $doc->createElement("gallery");
$doc->appendChild($r);
$CatArray[] = "0";
$count = 1;
$q = mysql_query("SELECT * FROM MusicPlayer ORDER BY Category");
while($f = mysql_fetch_array($q)) {
if (in_array($f[Category], $CatArray) == false) {
if ($count != 1) {
$r->appendChild($b);
}
$b = $doc->createElement("category");
$b_attr1 = $doc->createAttribute('name');
$b->appendChild($b_attr1);
$b_attr1->appendChild($doc->createTextNode($f[Category]));
$CatArray[] = $f[Category];
}
$artist = strtoupper($f[Artist]);
$song = strtoupper($f[SongName]);
$item = $doc->createElement("item");
$item_attr1 = $doc->createAttribute('mp3Path');
$item->appendChild($item_attr1);
$item_attr1->appendChild($doc->createTextNode($url.$f[Filename]));
$item_attr2 = $doc->createAttribute('played');
$item->appendChild($item_attr2);
$item_attr2->appendChild($doc->createTextNode('0'));
$itemdata = '<font face="Font" color="#198a56">'.$artist.': </font><font face="Font" color="#FFFFFF">'.$song.'</font>';
$itemdata_cd = $doc->createCDATASection($itemdata);
$item->appendChild($itemdata_cd);
$b->appendChild($item);
$count++;
}
$r->appendChild($b);
echo $doc->saveXML();
?>
Does anyone know why it would not be loading correctly? Is there a better way to create an XML file from dynamic MySQL data?
Thanks everyone.