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();
    $useragent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20061204 Firefox/";
    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);
    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("");
$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]");

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.