Dynadot โ€” .com Transfer

Test website exists in PHP

Spaceship Spaceship
Watch

PoorDoggie

Soon to be RICHdoggie!VIP Member
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
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
curl
 
0
•••
labrocca said:
hmm... thanks, but how would I use that?

Thanks
Tom
 
0
•••
http://ca.php.net/curl

PHP:
$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";
}
 
Last edited:
0
•••
thanks everyone! :)
 
0
•••
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back