Jump to content

PHP and XML - Edit XML file


AndieB

Recommended Posts

Hi all Gurus!

 

My scenario:

I have a FLASH Player that plays MP3 files on a webpage.

The MP3 FLASH Player uses an playlist.xml to get it necessary information about name, title and .mp3 file location.

In order to add, remove or edit my playlist, I need to download the playlist.xml file, edit it in a notepad application and than upload it again (together with the .mp3 files of course).

 

My need of help:

How do I create a PHP script that reads the file and publishes it so that I can edit it or add tracks using for example forms.

Anyone who has a great script or know where to get one or perhaps knows a great "walkthrough"?

 

Thanks in advance!

 

Andreas

Link to comment
https://forums.phpfreaks.com/topic/68371-php-and-xml-edit-xml-file/
Share on other sites

The playlist XML file looks like this:

 

<?xml version="1.0" encoding="UTF-8" ?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
    <title>HERE GOES THE TITLE</title>
    <info>http://www.jeroenwijering.com/?item=Flash_MP3_Player</info>
    <trackList>
  		<!-- You need one of these blocks of code for each song in your playlist. --> 
  		<!-- You can simply copy-paste one of these blocks to add a song. --> 
        <track>
        	<!-- here you insert your song's title --> 
            <annotation>90 Mix</annotation>
        	<!-- here you insert the location of your mp3 file --> 
            <location>mp3/90Mix.mp3</location>
        	<!-- here you insert a link for this song, or leave it blank for no link --> 
            <info></info>
        	<!-- here you insert the location of the cover art jpg, or leave it blank --> 
		<image></image>
        </track>
        <!-- this is the end of the code for one song --> 

</playlist>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.