Outputting the status lines returned by web servers
$to_check = array ("www.rntsoft.com" => "/index.htm");
foreach ( $to_check as $host => $page ){
$fp = fsockopen( "$host", 80, &$errno, &$errdesc, 10);
print "Trying $host
\n";
if ( ! $fp ){
print "Couldn't connect to $host:\n
Error: $errno\n
Desc:$errdesc\n";
print "
\n";
continue;
}
print "Trying to get $page
\n";
fputs( $fp, "HEAD $page HTTP/1.0\r\n\r\n" );
print fgets( $fp, 1024 );
print "
\n";
fclose( $fp );
}
?>