Jump to content

Recommended Posts

I have a personal website with a mp3 player on it that uses a xml file to create a playlist. I am using a Flash object and javascript for the uploader (progress bar). Anyways my problem is I am using $_POST to get the variables from the flash form to the php script which works just fine for one song. If I upload another song all previous uploads, song name(s) and artist(s) are replaced by the most recent $_POST. I have the script written so it will rewrite the xml file entirely to update it, as I have a delete file script as well. I need to somehow find a way to either link the file to the fash variables previously posted or a script to create a log.txt flat file database to assign them with arrays. Basiclly I have it writing

 

<title>".str_replace(".mp3","",$song)."</title>\n  <creator>".str_replace(".mp3","",$artist)."</creator>\n

 

this is how the mp3 player reads the xml correctly...where $song = $_POST["song"];

$artist = $_POST["artist"]; from the flash form.

 

Anything will help...or maybe a way I haven't thought of to make it eaiser...perhaps with a sessionkey or something.

 

THANKS!

I've considered that but I would rather not not because if I use the delete script then I will have a song on my playlist that will not have a file to play as it will have been deleted..unless I could write the delete script to delete the text in the xml file?

Well yes i guess...I am just trying to think of the best route to take. I don't exactly know how to write that. Right now I have a script that will list files in my upload dir and I have a link to delete them, I don't know how I could use php to find the information for that file and delete it in the xml file while keeping it in structure for the mp3 player to read.

 

However, I just had another thought but don't know where to go with it. If I could get some feedback on if it could work and how. When I upload the file it is then moved and renamed with php. From there could I assign the form variables into the file name and somehow have php break down the file name to write the xml? For example have it renames an uploaded song from the tmp_file (music.mp3 or what ever the tmp_name is) to (music.mp3.$_POST[songname].$_POST[artistname]) Then use a string replace or assign them a variable somehow? That's where I'm not sure.

 

Thanks again!

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.