SireJoe Posted January 15, 2008 Share Posted January 15, 2008 Ok, so heres what Im looking to do, and am half doing I want my URL to redirect my users to a video page that will have a playlist dynamically created via PHP. The PHP doc will look in the given folder and spit out the .asx file (.asx are treated as .php on my server). I have the file that can create the .asx's on the fly. I have the player that can play the .asx via the "?src=" within the URL. The only issue is, that when I get the media player to call the .asx file so that the code can create the playlist, I am unable to pass the information onto that file. Uhh, so its like this: videoplayer.php -> playlist.asx -> "?srcpath=" string -> create .asx from folder contents -> videoplayer.php plays playlist I cannot get the ?srcpath= to my .asx PHP file. Whenever I try to query the string from my vidplayer.php page it strips the attached string. So all my .asx file sees is http://mydomain.com/playlist.asx NOT http://mydomain.com/playlist.asx?srcpath=folderhere I dunno how clear this is. But what I need is to somehow get my string from the vidplayer.php URL through to my playlist.asx. playlist (fldrd.asx) code right now: <? $fld1 = $_SERVER['REQUEST_URI']; $fld = $_SERVER['QUERY_STRING']; $trimd = explode("srcpath=", $fld); $folder= dir("/var/www/vhosts/mydomain.com/httpdocs/Members/vidgallery/$trimd[1]"); $path = "http://www.mydomain.com/Members/vidgallery/$trimd[1]/"; echo "<ASX Version = \"3.0\">"; print "\n"; echo "<Title></Title>"; print "\n"; while($folderEntry=$folder->read()){ if ($folderEntry !="fldrd.asx" & $folderEntry !="." & $folderEntry !="..") { echo "<ENTRY>"; print "\n"; echo "<Title></Title>"; print "\n"; echo "<REF HREF=\""; echo $path; echo $folderEntry; echo " />"; print "\n"; echo "</ENTRY>"; print "\n"; } } $folder->close(); echo "</ASX>"; ?> ---------------------- URL strings being used: http://www.mydomain.com/Members/vidgallery/qthigh.php?src=fldrd.asx?srcpath=MM/A Media player looks like this: <OBJECT id="VIDEO" width="720" height="640" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> <PARAM NAME="URL" VALUE="<? echo $_GET['src']; ?>"> <PARAM NAME="SendPlayStateChangeEvents" VALUE="True"> <PARAM NAME="AutoStart" VALUE="True"> <PARAM NAME="AllowScan" VALUE="Yes"> <PARAM NAME="EnablePositionControls" VALUE="Yes"> <PARAM NAME="Enabled" VALUE="Yes"> <PARAM NAME="ShowDisplay" VALUE="Yes"> <PARAM NAME="ShowGotoBar" VALUE="Yes"> <PARAM NAME="Prebuffer" VALUE="true"> <PARAM name="uiMode" value="full"> <PARAM name="PlayCount" value="1"> </OBJECT> -------------------------------- In any event, any help would be greatly appreciated! Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/86090-solved-illogical-php/ Share on other sites More sharing options...
priti Posted January 15, 2008 Share Posted January 15, 2008 Hi, $trimd = explode("srcpath=", $fld); can you show us what in $trimd and kindly print $fld. regards Quote Link to comment https://forums.phpfreaks.com/topic/86090-solved-illogical-php/#findComment-439641 Share on other sites More sharing options...
tibberous Posted January 15, 2008 Share Posted January 15, 2008 Use mod_rewrite to rewrite the links, so rather than: http://mydomain.com/playlist.asx?srcpath=folderhere It's: http://mydomain.com/playlists/folderhere/playlist.asx You can use mod_rewrite to pass the part as a parameter or just parse the $_SERVER['REQUEST_URI'] RewriteEngine On RewriteRule ^playlists/(.*)/playlist.asx playlist.php?srcpath=$1 Read this: http://www.ilovejackdaniels.com/mod_rewrite_cheat_sheet.png Quote Link to comment https://forums.phpfreaks.com/topic/86090-solved-illogical-php/#findComment-439646 Share on other sites More sharing options...
SireJoe Posted January 15, 2008 Author Share Posted January 15, 2008 Hi, $trimd = explode("srcpath=", $fld); can you show us what in $trimd and kindly print $fld. regards It depends on the input in the URL. It either returns nothing, as with the case right now. Or will return the proper folder name. Its all based on .php?src=fldrd.asx?srcpath=dir/dir. In theory it should return " dir/dir " or to that effect. Quote Link to comment https://forums.phpfreaks.com/topic/86090-solved-illogical-php/#findComment-439656 Share on other sites More sharing options...
SireJoe Posted January 15, 2008 Author Share Posted January 15, 2008 Use mod_rewrite to rewrite the links, so rather than: http://mydomain.com/playlist.asx?srcpath=folderhere It's: http://mydomain.com/playlists/folderhere/playlist.asx You can use mod_rewrite to pass the part as a parameter or just parse the $_SERVER['REQUEST_URI'] RewriteEngine On RewriteRule ^playlists/(.*)/playlist.asx playlist.php?srcpath=$1 Read this: http://www.ilovejackdaniels.com/mod_rewrite_cheat_sheet.png If I do it that way, then I will need to have my .asx file in every folder that I have my media stored, correct? If so, thats what I am trying to avoid. Also, if anyone hows how to sort this correctly, I would appreciate that too Quote Link to comment https://forums.phpfreaks.com/topic/86090-solved-illogical-php/#findComment-439657 Share on other sites More sharing options...
priti Posted January 15, 2008 Share Posted January 15, 2008 hi, I see .php?src=fldrd.asx?srcpath=dir/dir in your post and can point you that instead of .php?src=fldrd.asx?srcpath=dir/dir you whould create url like .php?src=fldrd.asx&srcpath=dir/dir two question marks in the query string ...i never seen them before :-) Quote Link to comment https://forums.phpfreaks.com/topic/86090-solved-illogical-php/#findComment-439665 Share on other sites More sharing options...
SireJoe Posted January 15, 2008 Author Share Posted January 15, 2008 hi, I see .php?src=fldrd.asx?srcpath=dir/dir in your post and can point you that instead of .php?src=fldrd.asx?srcpath=dir/dir you whould create url like .php?src=fldrd.asx&srcpath=dir/dir two question marks in the query string ...i never seen them before :-) I did that to pass on the string through to the .asx file. The other way with the ampersand leaves it off. Or so I was trying anyways. There is only one way that I have tried that works in getting the string into the .asx page via the vidpage. that is an alteration in the URL that the media player uses. such as instead of fldrd.asx it will be fldrd.asx?srcpath=dir/dir (here: <PARAM NAME="URL" VALUE="<? echo $_GET['src']; ?>">) . The problem with that is though, that the media player no longer recognizes the file as a .asx. and cannot play the content. I have tried direct folder inputs and a proper .asx file to see if I could use that variation, and it would just not play the file. Quote Link to comment https://forums.phpfreaks.com/topic/86090-solved-illogical-php/#findComment-439668 Share on other sites More sharing options...
SireJoe Posted January 15, 2008 Author Share Posted January 15, 2008 is there anyone else that can help with this? i really need to get this thing working. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/86090-solved-illogical-php/#findComment-440260 Share on other sites More sharing options...
SireJoe Posted January 15, 2008 Author Share Posted January 15, 2008 Use mod_rewrite to rewrite the links, so rather than: http://mydomain.com/playlist.asx?srcpath=folderhere It's: http://mydomain.com/playlists/folderhere/playlist.asx You can use mod_rewrite to pass the part as a parameter or just parse the $_SERVER['REQUEST_URI'] RewriteEngine On RewriteRule ^playlists/(.*)/playlist.asx playlist.php?srcpath=$1 Read this: http://www.ilovejackdaniels.com/mod_rewrite_cheat_sheet.png Ok, so i have been trying this, and my server does not redirect me for some reason. I have tried to simplify the rewrite rule and it still seems to not respond. I'm not sure what to do here.... Quote Link to comment https://forums.phpfreaks.com/topic/86090-solved-illogical-php/#findComment-440420 Share on other sites More sharing options...
SireJoe Posted January 16, 2008 Author Share Posted January 16, 2008 I just want to say this topic is solved, and if anyone wants the source code of how I did it, please let me know! And a VERY big THANK YOU to Zavaboy for helping me finish it off! Quote Link to comment https://forums.phpfreaks.com/topic/86090-solved-illogical-php/#findComment-441373 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.