• 25-02-2015, 23:27:19
    #1
    Arkadaşlar hititbet bwin gibi sitelere curl ile bot yazmaya çalışıyorum. Fakat benim kodlar ile siteye ulaşamyorum. Büyük ihtimal sitede engel var botlara karşı bunu aşmam mümkün mü?

    Curl Fonksiyonum

    	function Baglan($url){
    	
    		$curl = curl_init();//Curl başlattık
    		curl_setopt($curl,CURLOPT_URL,$url);//Gideceğimiz Url
    		curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
    		curl_setopt($curl,CURLOPT_USERAGENT,$_SERVER["HTTP_USER_AGENT"]);
    		$cikti = curl_exec($curl);
    		curl_close($curl);
    		return str_replace(array("\n","\t","\r"),null,$cikti);
    	
    	}
  • 26-02-2015, 01:06:31
    #2
    Genelde böyle sitelere bot yazarken cURL ile böyle sorunlar yaşanır. Bunları aşmak için cURL ile hedef siteye header bilgilerini göndermen gerekiyor. Kolay gelsin.
  • 26-02-2015, 01:10:26
    #3
    Üyeliği durduruldu
    CEU'nun da dediği gibi;

    $headers = array();
    $headers[] = 'X-Apple-Tz: 0';
    $headers[] = 'X-Apple-Store-Front: 143444,12';
    $headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
    $headers[] = 'Accept-Encoding: gzip, deflate';
    $headers[] = 'Accept-Language: en-US,en;q=0.5';
    $headers[] = 'Cache-Control: no-cache';
    $headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=utf-8';
    $headers[] = 'Host: [url]www.example.com';[/url]
    $headers[] = 'Referer: [url]http://www.example.com/index.php';[/url] //Your referrer address
    $headers[] = 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0';
    $headers[] = 'X-MicrosoftAjax: Delta=true';
    
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);