<html> <head> <title>Outputting the status lines returned by web servers</title> </head> <body> <?php $to_check = array ("www.navioo.com" => "/index.htm"); foreach ( $to_check as $host => $page ){ $fp = fsockopen( "$host", 80, &$errno, &$errdesc, 10); print "Trying $host<BR>n"; if ( ! $fp ){ print "Couldn't connect to $host:n<br>Error: $errnon<br>Desc:$errdescn"; print "<br><hr><br>n"; continue; } print "Trying to get $page<br>n"; fputs( $fp, "HEAD $page HTTP/1.0rnrn" ); print fgets( $fp, 1024 ); print "<br><br><br>n"; fclose( $fp ); } ?> </body> </html>
|