<?php
if (!$port) {$port=80;}
$sock=fsockopen($server,$port);
fwrite($sock,"$query $url HTTP/1.1\n");
fwrite($sock,"Host: $server\n");
fwrite($sock,"\n");
if ($query=="POST"){fwrite($sock,$postdata);}
$temp=fgets($sock,4096);
while ($temp!="\n" && $temp!="\r\n") {
$temp=fgets($sock,4096);
}
$temp=fgets($sock,4096);
while (!feof($sock)) {
print fgets($sock,4096);
}
?>
This code is supposed to get an HTTP document from another server. However, when I use it, it randomly inserts text into what it sends back. It is online at http://www.z3p.f2s.com/proxy.php3
Any ideas?
-P