Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Pobieranie źródła strony i Bad Request
help_mee
post
Post #1





Grupa: Zarejestrowani
Postów: 244
Pomógł: 21
Dołączył: 10.02.2008
Skąd: Załęcze Wielkie

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


Witam.

Pobieram funkcją fsockopen " title="Zobacz w manualu PHP" target="_manualstronę www i wysyłam nagłówki

Kod
GET / HTTP/1.1\r\n Host: www.csotam.pl/id/23/ \r\n Connection: Close\r\n\r\n


Lecz zwraca mi:

Kod
Bad Request

Your browser sent a request that this server could not understand.


Co jest nie tak?! (IMG:http://forum.php.pl/style_emoticons/default/snitch.gif)

  1. <?php
  2. $fp = fsockopen("csotam.pl", 80, $errno, $errstr, 30);
  3. if (!$fp) {
  4.    echo "$errstr ($errno)<br />\n";
  5. } else {
  6.    $headers= "GET / HTTP/1.1r\n Host: www.csotam.pl/id/23/ r\n Connection: Closer\nr\n";
  7.    fwrite($fp, $headers);
  8.    while (!feof($fp)) {
  9.        echo fgets($fp, 128);
  10.    }
  11.    fclose($fp);
  12. ?>
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: 11.10.2025 - 07:35