Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> fsockopen
kiamil
post
Post #1





Grupa: Zarejestrowani
Postów: 26
Pomógł: 0
Dołączył: 16.03.2008

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


Zwraca mi wiadomość:

HTTP/1.1 200 OK Date: Wed, 03 Sep 2008 11:24:27 GMT Server: Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5 X-Powered-By: PHP/5.2.5 Content-Length: 13 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html To jest test!

A chciałbym żeby mi wyświetlało samo "To jest tekst!" - jak to zrobić?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
kiamil
post
Post #2





Grupa: Zarejestrowani
Postów: 26
Pomógł: 0
Dołączył: 16.03.2008

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


Nadal się wyświetla, oto kod z zamontowanym skryptem:
  1. <?php
  2.  
  3. $host = '127.0.0.1';
  4. $uri = '/fsockopen1.php';
  5.  
  6. $nl = "r\n";
  7. $header = 'GET ' . $uri . ' HTTP/1.1' . $nl;
  8. $header .= 'Host: '. $host . $nl;
  9. $header .= 'User-Agent: ' . phpversion() . $nl;
  10. $header .= 'Accept-Language: pl,en-us;q=0.7,en;q=0.3' . $nl;
  11. $header .= 'Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7' . $nl;
  12. $header .= 'Keep-Alive: 300' . $nl;
  13. $header .= 'Connection: keep-alive' . $nl . $nl;
  14.  
  15. $sock = fsockopen($host, 80, $errno, $errstr) or
  16. die($errno . ' - ' . $errstr);
  17. $zm = explode("\n\n", $sock);
  18. unset($zm[0]);
  19. echo implode("\n\n", $zm);
  20.  
  21. fwrite($sock, $header);
  22.  
  23. while(!feof($sock)) echo fgets($sock, 1024);
  24.  
  25. fclose($sock); 
  26.  
  27. ?>
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: 2.10.2025 - 16:43