Jump to content

HELP ME !!! **adding 2 php codes togather*


Sangha-08

Recommended Posts

I have a website which grabs the flv from veoh.com. I have a simple embedding page. http://mywebsite.com/embed.php?file=THE VIDEO ID

Here is the code on the embedding page :

 

<p><center><embed 
src="/player.swf" 
width="540" 
height="438"
allowscriptaccess="always" 
allowfullscreen="true" 
flashvars="&file=/vid.php?video_url=http://www.veoh.com/videos/<?php print $_GET['file']; ?>&type=flv&backcolor=0x000000&frontcolor=0x0066FF&lightcolor=0xFFFFFF&searchbar=false&autostart=true" 
/></center></p>

 

The vid.php works in firefox only, it dosent seem to work in internet explorer ! but it should work fine when executed within the page. so that now the code looks like this and nobody gets to know about vid.php

 

<p><center><embed 
src="/player.swf" 
width="540" 
height="438"
allowscriptaccess="always" 
allowfullscreen="true" 
flashvars="&file=http://www.content.veoh.com/somerandomvideo.flv&type=flv&backcolor=0x000000&frontcolor=0x0066FF&lightcolor=0xFFFFFF&searchbar=false&autostart=true" 
/></center></p>

 

Here is the code for the vid.php

 

<?php
$video_url = (isset($_GET["video_url"])) ? strval($_GET["video_url"]) : "http://www.veoh.com/videos/v12260364bRgjmxjg";
getFlv($video_url);
function getFlv($video_url)
{
preg_match('/http:\/\/www.veoh.com\/videos\/(.*)/', $video_url, $match);
$details_url = 'http://www.veoh.com/rest/video/' . $match[1] . '/details';
if ($details = file("$details_url"))
{
foreach($details as $value)
{
// fullPreviewHashPath="http://content.veoh.com/flash/p/1288822/77c44b0448a3602f79d059c8e91e556ebf9e1b13.flv?ct=bf1913ed8788db2c804b5961e62ad111906735f5ca8e489c"
if(preg_match('/fullPreviewHashPath=\"(.*?)\"/', $value, $match))
{
$url = $match[1];
}
}
header('Location:' . $url);
}
}

?>

 

I tried really hard to execute the veoh.php in my embedding page, but it simply dosent work ! can any1 help me ? I know that you can execute them within the page ( like i saw on some other website). Can someone please help me ?

Link to comment
https://forums.phpfreaks.com/topic/107279-help-me-adding-2-php-codes-togather/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.