Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Working At Localhost , Not Working On Website (http://www.go4expert.com/forums/localhost-website-t8269/)

SNaRe 15Jan2008 18:43

Working At Localhost , Not Working On Website
 
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]");

?>


shabbir 15Jan2008 20:22

Re: Working At Localhost , Not Working On Website
 
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.


All times are GMT +5.5. The time now is 20:33.