Query remote website for activity

verenion's Avatar, Join Date: Dec 2008
Newbie Member
Hello, i am new here so any help would be appriciated!

I am basically looking for a function to do this:


PHP Code:
$result QueryWebsite($WebsiteURL);
  if (
$result) { return true; } else {return false;} 
The function would query the website, if a reply is recieved, then the website is active, if not it is inactive and i can use email alerts to email me.. etc..

I am a web developer and this is going to be part of a web design manager so i can see if any sites i maintain have been inactive.

Thanks in advance
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Try to use the system command like ping / nslookup and if you get a valid ip for the host name means it has a live website.
0
verenion's Avatar, Join Date: Dec 2008
Newbie Member
Quote:
Originally Posted by shabbir View Post
Try to use the system command like ping / nslookup and if you get a valid ip for the host name means it has a live website.
I Assume you mean the PEAR package? i didnt realy think of using ping, cheers ill have a look at that