Forum Moderators: coopster
function valid_url($str)
{
if (@fopen($str,"r"))
return 1;
else
return 0;
}
if (!valid_url($url)){
$error .= "<li>The URL, <em>$url</em>, does not exist.</li>";
}
I have tried using file(), as well. Any help is appreciated!
Birdman
HTTP/1.1 302 Moved Temporarily
Date: Tue, 23 Sep 2003 21:44:38 GMT
Location: [sitefinder.verisign.com...]
Content-Type: text/plain
Transfer-Encoding: Chunked
Connection: Close
You can parse the Location line and assume(?) a bad URL.
function valid_url($str)
{
if($test = implode("\r",file($str))){
if (strpos($test,"<title>VeriSign ¦")){
return 0;
} else {
return 1;
}
} else {
return 0;
}
}
If anyone has a more ellegant solution, I'm all ears ;)
Birdman
ps. That's the beauty of dynamic pages...predictability!