Frankenkill Posted January 15, 2010 Share Posted January 15, 2010 Hi phpfreaks I've got a bit of a problem. I created a php page that retrieves the url to a videofile by checking a website's source code. The php page works like a dream, but now comes the video part. I want the URL of the video to be "echo'd" directly into my videoplayer. This works also.. but when I try to play the video.. it say's the videofile doesn't exists. This is the problem. The videofile does exist, because I've checked that, plus it is retrieved directly from the other website's source code. My gues is that the video-url is echo'd wrong into the player (with special characters or something). I already checked this, but I can't find the problem! Please take a look at my code and help me out! Thanks!! <html> <head> <?php $vidurl=$_GET['vid']; // dynamic URL to find the videofile on. $contents = file_get_contents($vidurl); // retrieve source code function get_string_between($string, $start, $end){ $string = ' '.$string; $ini = strpos($string,$start); if ($ini == 0) return ''; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini; return substr($string,$ini,$len); } $vidurl2=get_string_between($contents, '("file","', '");'); // strip code and store only the videofile into variable ?> </head> <body> <?php echo $vidurl2; // echo to check if the code is retrieved the correct URL. This works! so the file is retrieved correctly.. ?> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> swfobject.registerObject("player","9.0.98","expressInstall.swf"); </script> <object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="100%" height="100%"> <param name="movie" value="player.swf" /> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> <param name="flashvars" value="file=<?php echo $vidurl2; ?>" /> <object type="application/x-shockwave-flash" data="player.swf" width="100%" height="100%"> <param name="movie" value="player.swf" /> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> <param name="flashvars" value="file=<?php echo $vidurl2; ?>" /> <p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p> </object> </object> </center> </body> </html> [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/188561-challenging-phpsource-codevideo-problem-please-help/ Share on other sites More sharing options...
oni-kun Posted January 15, 2010 Share Posted January 15, 2010 If the video is displaying the video name, it clearly is missing a .flv at the end.. ? Quote Link to comment https://forums.phpfreaks.com/topic/188561-challenging-phpsource-codevideo-problem-please-help/#findComment-995495 Share on other sites More sharing options...
Frankenkill Posted January 15, 2010 Author Share Posted January 15, 2010 If the video is displaying the video name, it clearly is missing a .flv at the end.. ? Nope, the video error issn't showing the whole url.. just the first couple of characters Quote Link to comment https://forums.phpfreaks.com/topic/188561-challenging-phpsource-codevideo-problem-please-help/#findComment-995498 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.