* Thus wrote Henry Grech-Cini ([EMAIL PROTECTED]):
> Hi All,
>
> I am trying to check if a website is up (reachable) and I have used the
> standard code below:
>
> else
> {
> fwrite ($socket, "HEAD ".$documentpath." HTTP/1.0\r\nHost:
> $host\r\n\r\n");
> $http_response = fgets( $socket, 22 );
any reason why you want only 22 bytes?
A response like the following is perfectly valid:
HTTP/1.0 200 its ok but the content wont be
>
> if ( ereg("200 OK", $http_response, $regs ) )
Any response back would mean its up.
> {
> return(true);
> fclose( $socket );
> } else
> {
> // echo "HTTP-Response: $http_response<br>";
What does this say?
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php