Jump to content

[SOLVED] Passing a variable through url, while already passing a url variable...


swampdiner

Recommended Posts

Sorry for the confusing subject, but let me clarify. I am trying to set up a media player that reads a on the fly generated php playlist. What I would like to do is pass a variable to the playlist_generator.php file. I am successful when passing it straight to it, but the media player needs to pass the variable and I don't know how to tell it that it's for the playlist.php file and for it. Sounds confusing ha. Here is what i mean-

<embed src="xspf_player.swf?playlist_url=playlist_generator.php?path=$path&autoload=true&autoplay=true"

How can I distinguish that I want to pass the $path variable to the playlist_generator in

playlist_generator.php?path=$path

and not to the swf? I feel like there is a simple answer, but I have no idea what keywords I should have googled.

Thank you in advanced.

Link to comment
Share on other sites

playlist_generator.php needs to echo the playlist <location></location>

 

so make $path an id and get the info from the database

 


$path = $_GET['path'];

if ($path !=""){
$query = "SELECT * FROM video WHERE file_id='{$path}' ";
$result = mysql_query($query)or die(mysql_error());

echo '<?xml version="1.0" encoding="UTF-8"?><playlist xmlns="http://xspf.org/ns/0/" version="1"><title>mixmedia</title> <tracklist>';

$row = mysql_fetch_array($result);

        $file = "/files/".$row['swfname']; //location of file here


    echo"<track>
      <location>".$file."</location>
    </track>";
   

echo '</tracklist></playlist>';
}

Link to comment
Share on other sites

I appreciate your replay, but I don't have any problems with the actual playlist_generator.php page. My problem was passing it a variable in that embed source because it was already taking variables and there was no way to distinguish that the variable was supposed to go to the generator. What I did to solve this was to give up trying to send the variable through the url and just created a shortlived cookie instead. Thanks for the quick reply.

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.