Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]socket, fread, bufor
-gog-
post 14.03.2008, 19:15:54
Post #1





Goście







dopiero zaczynam i juz mam problem ktory dla mnie jest nie do przeskoczenia..

oto kod
Kod
<?php
$fp=fsockopen("wp.pl", 80);
fwrite($fp, "GET /index.php HTTP/1.1
User-Agent: Opera/9.50 (Windows NT 5.1; U; en)
Host: wp.pl
Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Language: pl-PL,pl;q=0.9,en;q=0.8
Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1
Accept-Encoding: deflate, identity, *;q=0
Cache-Control: no-cache
Connection: Keep-Alive, TE
TE: deflate, gzip, chunked, identity, trailers
");

ob_start();
echo fread($fp, 9000);
$dane2 = ob_get_contents();
   $file = "wp.txt";
   $fp = fopen($file, "a+");
   fwrite($fp, stripslashes($dane2));
   ob_end_clean();
fclose($fp);
?>


Wszystko dziala z jedym ale, czyta tylko te 9000 znakow czy bajtow whatever, jak zrobic zeby czytalo do konca?
Go to the top of the page
+Quote Post

Posty w temacie
- gog   [php]socket, fread, bufor   14.03.2008, 19:15:54
- - jacus24   Zamiast fread użyj file albo readfile.   14.03.2008, 19:23:01
- - Gość   yyyy moglbys napisac jak to ma wtedy wygladac bo c...   14.03.2008, 19:40:10
- - jacus24   chyba tak [PHP] pobierz, plaintext <?phpob_star...   14.03.2008, 19:49:06
- - gog   ani jedno ani drugie nie dziala...   14.03.2008, 19:52:51
- - gog   Any more ideas?   14.03.2008, 19:56:13
- - Gość   dobra, dalem po prostu Kodob_start(); ech...   14.03.2008, 20:06:36


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

 



RSS Wersja Lo-Fi Aktualny czas: 14.07.2025 - 23:44