Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fread bug?

Status
Not open for further replies.

fykosak

Programmer
Dec 17, 2001
11
CZ
Dear Everyone,
I've written a simple script that get's a page from another web server using fsockopen and fread. On some versions of apache it displays some hexa numbers in the output. It seems to me that it the lenght of the page and it appears every time the buffer is filled. Does anybody else have an experience with this? any help?
thanx 2 all,
fykosak
 
post the code, lemme play :) ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
well, here we go
<?
$remote_host = &quot;mrobin.host.sk&quot;;
$remote_url = &quot;/&quot;;
$remote_port = 80;
$remote = fsockopen($remote_host,$remote_port);
if (!$remote) {
print &quot;Connection failed...<br>\n&quot;;
} else {
fwrite($remote,&quot;GET $remote_url HTTP/1.1\n&quot;);
fwrite($remote, &quot;Host: $remote_host\n&quot;);
fwrite($remote,&quot;User-Agent: Opera/6.03\n\n&quot;);
while(!feof($remote)) {
echo fread($remote, 1024);

}
}
?>
well, that should be all...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top