• 20-09-2021, 14:32:31
    #1
    Üyeliği durduruldu
    merhaba dostlar php ile referer yollamaya çalıştım ama hala kendi sitem gözüküyor nerde hatam olabilir?

    <?php
    
    
    function curl($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);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_REFERER, 'https://www.siteadi.com/');
        $icerik = curl_exec($ch);
        curl_close($ch);
        return $icerik;
    }
    
    function ara($bas, $son, $yazi)
    {
        @preg_match_all('/' . preg_quote($bas, '/') .
        '(.*?)'. preg_quote($son, '/').'/i', $yazi, $m);
        return @$m[1];
    }
    $icerik = file_get_contents("https://www.xxxxxxxxxxx/index.php?id=6345109");
    $baslik = ara("file: '","',", $icerik);
    
    ?>
  • 20-09-2021, 14:40:05
    #2
    Veriyi file get contents ile değil curl ile çekmelisiniz.
  • 20-09-2021, 14:41:30
    #3
    Üyeliği durduruldu
    coderutd adlı üyeden alıntı: mesajı görüntüle
    Veriyi file get contents ile değil curl ile çekmelisiniz.
    teşekkürler hocam o şekildede denedim aynı olmadı

  • 20-09-2021, 14:45:11
    #4
    emirhan40 adlı üyeden alıntı: mesajı görüntüle
    teşekkürler hocam o şekildede denedim aynı olmadı

    Görseldeki kodun çalışması lazım hocam, $source değişkeni hedef sitenin kaynak kodunu içerecektir.
  • 20-09-2021, 15:42:44
    #5
    Üyeliği durduruldu
    teşekkürler henüz çözemedim bakabilcek var mi?
  • 20-09-2021, 15:49:46
    #6
    Merhaba curl ile bağlanmak için bir fonksiyon var ama kullanmıyorsunuz.
    $icerik = file_get_contents("https://www.xxxxxxxxxxx/index.php?id=6345109");

    $icerik = curl("https://www.xxxxxxxxxxx/index.php?id=6345109");
    bu şekilde çalışıyor, test ettim.