Re: Checking if a website is up?

From: Date: Tue, 30 Mar 2004 10:47:21 +0000
Subject: Re: Checking if a website is up?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-181798@lists.php.net to get a copy of this message
I am trying to check if a website is up (reachable) and I have used the standard code below: [...]
      $socket = @fsockopen( $host, $port, $errno, $errstr, 30 );
       if (!$socket)
          fwrite ($socket, "HEAD ".$documentpath." HTTP/1.0\r\nHost:
$host\r\n\r\n");
           $http_response = fgets( $socket, 22 );
           if ( ereg("200 OK", $http_response, $regs ) )
Maybe you can find something in the curl functions? http://nl3.php.net/manual/nl/ref.curl.php

« previous php.general (#181798) next »