Working At Localhost , Not Working On Website

Discussion in 'PHP' started by SNaRe, Jan 15, 2008.

  1. SNaRe

    SNaRe New Member

    Joined:
    Jan 15, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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:
    <?
    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($chCURLOPT_USERAGENT$useragent);
        
    curl_setopt($chCURLOPT_URL"$url");
        
    curl_setopt($chCURLOPT_POST1);
        
    curl_setopt($chCURLOPT_FOLLOWLOCATION0);
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
    curl_setopt($chCURLOPT_HEADERtrue);
        
    $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($strnull'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]");

    ?>
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,374
    Likes Received:
    388
    Trophy Points:
    83
    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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice