• 27-12-2012, 14:30:22
    #1
    Çekim yaptığım sitede yapılan yönlendirme yüzünden file_get_contents'te bu hatayı alıyorum. Curl ile aşmaya denedim olmadı.

    function getir($url){
    $oturum = curl_init();
    curl_setopt($oturum, CURLOPT_URL, $url);
    $h4 = $_SERVER['HTTP_USER_AGENT'];
    curl_setopt($oturum, CURLOPT_USERAGENT, $h4);
    curl_setopt($oturum, CURLOPT_HEADER, 0);
    curl_setopt($oturum, CURLOPT_RETURNTRANSFER, true);
    $source=curl_exec($oturum);
    curl_close($oturum);
    return $source;
    }
  • 27-12-2012, 14:34:10
    #2
    ShaDoW adlı üyeden alıntı: mesajı görüntüle
    Çekim yaptığım sitede yapılan yönlendirme yüzünden file_get_contents'te bu hatayı alıyorum. Curl ile aşmaya denedim olmadı.

    function getir($url){
    $oturum = curl_init();
    curl_setopt($oturum, CURLOPT_URL, $url);
    $h4 = $_SERVER['HTTP_USER_AGENT'];
    curl_setopt($oturum, CURLOPT_USERAGENT, $h4);
    curl_setopt($oturum, CURLOPT_HEADER, 0);
    curl_setopt($oturum, CURLOPT_RETURNTRANSFER, true);
    $source=curl_exec($oturum);
    curl_close($oturum);
    return $source;
    }
    Böyle denermisiniz

    function getir($url, $post=false){
        $user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6';
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, $post ? true : false);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post ? $post : false);
        curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
        $row = curl_exec($ch);
        curl_close($ch);
        return $row;
    }
  • 27-12-2012, 14:44:35
    #3
    Olmadı
  • 27-12-2012, 14:46:24
    #4
    Buraya bakarmisiniz https://bugs.php.net/bug.php?id=39095
  • 27-12-2012, 14:51:22
    #5
    Dün incelemiştim ama işin içinden çıkamadım.
  • 27-12-2012, 14:55:30
    #6
    Burda bir class var http://nuke-viet.googlecode.com/svn-...turl.class.php bir denermisiniz

    eger olmazsa ini_set("max_redirects",30);