Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Wstawianie nagłówka $headers
omi
post
Post #1





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 6.11.2017

Ostrzeżenie: (0%)
-----


Witam! Coś tu robię źle przy wstawianiu nagłówka, mam wstawić taki nagłówek: Accept-Encoding: deflate, gzip, br



Mój kod wygląda tak, co tu jest źle?

  1.  
  2. $ch = curl_init();
  3. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  4. curl_setopt($ch,CURLOPT_URL,"https://www.tibia.com/community/?subtopic=killstatistics&world=Dibra");
  5. curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  6. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13");
  7.  
  8.  
  9. curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  10.  
  11. $header[] = 'Accept-Encoding: gzip, deflate, br';
  12. $data = curl_exec($ch);
  13. $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  14. curl_close($ch);
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 11:30