PDA

View Full Version : Checking Site Question



dreamerp
November 4th, 2006, 03:11 PM
Hello,

Is it possible to check to see if a web site is up and running in PHP.

Can you send something to a website and if the site is up it sends back a certain value, but if it is not running then it can send back a different value?

Any help will help!

Thanks

hl
November 4th, 2006, 04:13 PM
@fsockopen("site/ip", 80, $errno, $errstring, 10);

That'll check if port 80 is working for that site (website is up). If it is not, it'll return 0... if it is.. it'll return 1. It'll try for 10 seconds before giving up.