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
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>

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.