Forum Moderators: coopster
Some people are removing the link to the script in the skin of our script
We have the following information with us in our database
client_name
client_url
client_status
i run a foreach loop after fetching data from the table
open the url using fopen and check for occurence of a link to "http://www.domain.com"
$urlContents = file($client_url);
for ($i=0; $i<count($urlContents ); $i++) {
$text = $text . $urlContents [$i];
}
if (eregi($client_url, $text)) {
true
}
else {
false
}
this part is working
i need to check for 404 errors on invalid domains
if i run this script when a domain is down i get this error
Warning: file() [function.file]: php_network_getaddresses: getaddrinfo failed: No such host is known. in validate.php on line 24
line 24 is $urlContents = file($client_url);
any way to handle this error
if ($urlContents = @file($client_url)) {
// all is well, do your stuff here ...
} else {
// FALSE was returned, handle accordingly
}