Hi All, Im hoping someone can help me here. What im looking at doing is having a flash mp3 player on my website, after looking over numerous flash players ive noticed that about 99% of them use an XML file to store all of the mp3's, cover images etc. Im creating a site for a client who wants a mp3 player on their website. The site im developing is going to have a custom built cms which im developing myself. The question i have is, can you update an XML file dynamically via a database? If so does anyone know who could do this for me? I propose to make a mysql table that stores all of the var's for each mp3 track, i then want the database to link to the xml file being used in the flash player..... What would you guys suggest? Regards Tom
ok this is the way you need to do it. create a new php file that will create the xml file. But it doesn't create a phsical one but a on-the-fly one. Step 1: Send a header that this file is an XML file <?php header ("content-type: text/xml"); PHP: then connect to the db mysql_connect('server','user','pass'); mysql_select_db('database'); PHP: and then build the xml file by quering the db and looping through the result. So if you have to provide the xml file to the players you can provide playlist.php and they will accept it as a header is sent that says that this is a xml file. hope this helps
You can store all of the track information in a database instead of xml. You can then easily query the database and generate dynamic xml to feed the player as suggested above. I would make sure to store the track in a directory and not in the database. Store the path to the file in the database but not the file itself.
Thanks for all your replies. This is the player ive decided to use - http://www.flashcomponentstemplates.com/freebies.html Below ive pasted the XML file that controls the player. Surely if i create a dynamic xml file the settings will need to be included too? Ideally i want to keep the settings standalone, and just have the tracks as a dynamic playlist if that makes sense. What would you guys suggest? Tom <?xml version="1.0" encoding="utf-8"?> <player> <settings defaultVolume = "1" autoplay = "true" mainBackgroundColor = "000000" buttonsBackgroundColor = "000000" buttonsOutlineColor = "ffffff" buttonsIconColor = "8A3090" buttonsIconOverColor = "FFFFFF" volumeBarColor = "FFFFFF" loadBarColor = "8A3090" progressBarColor ="00ffff" spectrumLeftColor = "ffffff" spectrumLeftLineColor = "FFFFFF" spectrumRightColor = "00ffff" spectrumRightLineColor = "00FFFF" /> <song> <title>Madcon - Beggin</title> <url>songs/Madcon - Beggin.mp3</url> </song> <song> <title>T.I. Ft Justin Timberlake - Dead And Gone</title> <url>songs/T.I. Ft Justin Timberlake - Dead And Gone.mp3</url> </song> <song> <title>Akon Feat Eminem - Smack That</title> <url>songs/Akon Feat Eminem - Smack That.mp3</url> </song> <song> <title>Eminem - Bagpipes From Baghdad</title> <url>songs/eminem-bagpipes_from_baghdad.mp3</url> </song> </player> PHP: