swampdiner Posted August 9, 2009 Share Posted August 9, 2009 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 https://forums.phpfreaks.com/topic/169484-solved-passing-a-variable-through-url-while-already-passing-a-url-variable/ Share on other sites More sharing options...
dreamwest Posted August 9, 2009 Share Posted August 9, 2009 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 https://forums.phpfreaks.com/topic/169484-solved-passing-a-variable-through-url-while-already-passing-a-url-variable/#findComment-894217 Share on other sites More sharing options...
swampdiner Posted August 10, 2009 Author Share Posted August 10, 2009 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 https://forums.phpfreaks.com/topic/169484-solved-passing-a-variable-through-url-while-already-passing-a-url-variable/#findComment-894856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.