Forum Moderators: coopster
Warning: feof(): supplied argument is not a valid stream resource in C:\[xampp_url]\return2.php on line 44 while(!feof($socket))
{
$line = @fgets( $socket, 1024 );
error_reporting($temp);
// Check if we are finished reading the header yet
if( strcmp( $line, "\r\n" ) == 0 )
{
// read the header
$headerDone = true;
}
// If header has been processed
else if( $headerDone )
{
// Read the main response
$res .= $line;
}
} set_time_limit(20);
ob_start();
header("Content-Type: text/plain");
$host = "www.webmasterworld.com";
$port = 80;
$post = "HEAD / HTTP/1.1\r\n";
$post .= "Host: www.webmasterworld.com\r\n";
$post .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2\r\n";
$post .= "Keep-Alive: 200\r\n";
$post .= "Connection: keep-alive\r\n\r\n";
$sock = fsockopen($host, $port, $errno, $errstr, 20.0);
fwrite($sock, $post, strlen($post));
while (!feof($sock)){
echo fgets($sock);
}
ob_end_flush(); HTTP/1.1 200 OK
Accept-Ranges: bytes
Date: Wed, 07 Apr 2010 05:36:02 GMT
Content-Type: text/html
Cache-Control: max-age=0
Connection: close
Server: Apache/2.0.52
Vary: Accept-Encoding,User-Agent
Pragma: no-cache
X-Powered-By: BestBBS v5.00alpha
Via: 1.1 cpt-cache-01 (NetCache NetApp/6.0.2)