Working At Localhost , Not Working On Website

SNaRe's Avatar, Join Date: Jan 2008
Newbie Member
I wrote a script to get dailymotion video's download link.
It's working on localhost but it's not working wwhen i upload it to my host.
I tried in other hostings to . Result same. When i upload and work on host dailymotion forbids. But at localhost it allows.
Is there anyone can help me
PHP Code:
<?
function baglanti($url)
{
    $ch = curl_init();
    $values=array("ip"=>"localhost");
    $useragent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
    curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
    curl_setopt($ch, CURLOPT_URL, "$url");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, true);
    $sonuc = curl_exec($ch);
    curl_close($ch);
    return $sonuc;

}
function utf8_urldecode($str)
{
    $str = preg_replace("/%u([0-9a-f]{3,4})/i", "&#x\\1;", urldecode($str));
    return html_entity_decode($str, null, 'UTF-8');
    ;
}
$temp = baglanti("http://www.dailymotion.com/related/6392044/video/x3wt8i_a-heartfelt-new-years-greeting_blog");
$pattern = '#url=(.*?)allowZoom#si';
preg_match_all($pattern, $temp, $data);

$url = $data[1][0];
$url = utf8_urldecode($url);
$parca = explode("&url=", $url);
Header("Location: $parca[1]");

?>
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
The reason could be your localhost is windows and you are hosting on the Linux server and you are not giving the path properly in the correct case because Linux is case sensitive.