Sorun session ile değil tahminim, Bende denedim giremedim session ile. gzip dönüyor.
Neyse baştan anlatalım nasıl buldugumuzu.
İlk önce normal olarak file_get_contents ve curl ile giriş yapmaya çalıştım. sürekli sayfayı yeniledim bazen normal bazende anormal çıkıyordu.
Sorunu daha iyi incelemek için headerlarına bakarak yeniledim
Normal çıkan sayfa
Alıntı
HTTP/1.1 200 OK Access-Control-Allow-Origin: * Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0 Content-Type: text/html; charset=UTF-8 Date: Thu, 06 Nov 2014 11:01:34 GMT Server: nginx Vary: Accept-Encoding Vary: Accept-Encoding Vary: Accept-Encoding Vary: User-Agent X-Id: 036 X-TT: 1 X-UA-Compatible: IE=Edge,chrome=1 Content-Length: 137519
Anormal çıkan sayfa
Alıntı
HTTP/1.1 200 OK Content-Encoding: gzip Access-Control-Allow-Origin: * Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0 Content-Type: text/html; charset=UTF-8 Date: Thu, 06 Nov 2014 11:01:46 GMT Server: nginx Vary: Accept-Encoding Vary: User-Agent X-Id: cab2529 X-TT: 1 X-UA-Compatible: IE=Edge,chrome=1 Content-Length: 22546
Bakdım ki encoding gzip ile geliyor. Daha sonra gzdecode foksiyonunu kullandım bir if bir else ve iş tamam.
+Bonus
Arkadaşın vermiş oldugu curl çalışmaz,
Curl ile istersen, curl parametrene şu aşağıdaki kodu yerleştir.
Alıntı
curl_setopt($ch,CURLOPT_ENCODING, '');
Kolay gelsin
--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 13:28:55 -->-> Daha önceki mesaj 13:25:20 --
+Plus curl ile sade hali ,
Alıntı
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.agame.com/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_ENCODING, '');
$site = curl_exec($ch);
print_r($site);