Forum Moderators: coopster
<?php
$file = fopen ("http://www.example.com/", "r");
if (!$file) {
echo "Site is Down";
exit;
} else {
echo "Site is Up";
exit;
}
fclose($file);
?>
which seems to work fine is the site is up, but if it's down i get this error:
Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed: No such host is known. in \remote.php on line 3
ideas anyone?
-Ken
[edited by: coopster at 6:19 pm (utc) on Sep. 14, 2005]
[edit reason] generalized url [/edit]