- Impact
- 18
I have tried the file_exists() function, but it doesn't seem to work with external websites. Is there anyway I can see if an external website (www.thiswebsite.com/scrpt.php?a=asd) exists?
Thanks
Tom
Thanks
Tom
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://my.domain.com/my_url.php" );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,10); //added
$result= curl_exec($ch);
if (empty($result))
{
echo "doesn't exist";
}
else
{
echo "exists";
}


