• 27-10-2014, 21:29:05
    #1
    Arkadaşlar php botu yapımında file_get_contents ile bildiğiniz gibi

    <?php
    $site = "http://www.hedefsite.org";
    $icerik = file_get_contents($site);
    echo $icerik;
    ?>
    bu kod ile hedef sitenin tüm içeriğini çekiyoruz. Sadece bu işlemi Curl ile bot yapımında nasıl yapıyoruz acaba? Yani içindeki değişkenleri vs. almak istemiyorum. sadece hedefsitenin tüm içeriği sayfada bassın istiyorum.

    Curl'e yeni giriş yapıyorumda )
  • 27-10-2014, 21:40:04
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    BURAYA SİTE ADRESİ yazan kısmı kendine göre güncelle. kolay gelsin.

    <php
    function siteye_baglan($feed,$coo=null,$ref=null){
    
            $ch = curl_init();
            $timeout = 0;
            curl_setopt ($ch, CURLOPT_URL, $feed);
            curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
            if(!empty($coo))
            {
                curl_setopt($ch, CURLOPT_COOKIEFILE, $coo);
                curl_setopt($ch, CURLOPT_COOKIEJAR, $coo);
            }
            if(empty($ref))
            {
                curl_setopt($ch, CURLOPT_REFERER,$feed);
            }
            else
            {
                curl_setopt($ch, CURLOPT_REFERER,$ref);
            }
            curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
            $veri= curl_exec($ch);
            curl_close($ch);
            return $veri;
    }
    
    $site = siteye_baglan("BURAYA SİTE ADRESİ");
    
    echo $site;
    ?>
  • 29-10-2014, 21:06:45
    #3
    Çok teşekkürler hocam.
  • 29-10-2014, 21:57:01
    #4
    ChechenWarrior adlı üyeden alıntı: mesajı görüntüle
    Çok teşekkürler hocam.
    Rica ederim. Bilgi paylaşınca güzel
  • 29-10-2014, 23:28:35
    #5
    https://www.r10.net/php/17372-curl-nedir.html
    Güzel bir makale.