Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] curl referer problem?
b4x
post
Post #1





Grupa: Zarejestrowani
Postów: 658
Pomógł: 95
Dołączył: 20.12.2005
Skąd: N54,35° E18,63° (Gdańsk)

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


Witam.
  1. <?php
  2. $ch = curl_init('http://mojastrona.pl/www/get.php');
  3.  
  4.       $headers = array(
  5.             'Host: www.mojastrona.pl',
  6.                         'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7',
  7.                         'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  8.                         'Accept-Language: pl,en-us;q=0.7,en;q=0.3',
  9.                         'Accept-Encoding: gzip,deflate',                  
  10.                         'Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7',
  11.                         'Keep-Alive: 300',
  12.                         'Connection: keep-alive',
  13.                         'Referer: <a href=\"http://www.mojastrona.pl/'&#092;" target=\"_blank\">http://www.mojastrona.pl/'</a>,
  14.                         'Cookie: PHPSESSID=b38e97fe38f0a30f9a68311331ffbe3b',
  15.                         );
  16.                        
  17. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers );
  18. curl_setopt($ch, CURLOPT_REFERER, ' <a href=\"http://www.mojastrona.pl/');&#092;" target=\"_blank\">http://www.mojastrona.pl/');</a>
  19. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  20.  
  21. $html = curl_exec($ch);
  22. echo $html;
  23. ?>


Z MojaStronaX.pl chce pobrać pewne dane z MojaStrona.pl - gdzie jest sprawdzane Referer - lecz MojaStrona.pl - nie wykrywa go. Ma ktoś jakies pomysły?(IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Jeśli wyśle przez Live HTTP Headers takie headery to jest ok ale przez curla nie :<
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: 23.12.2025 - 08:00