Jump to content

best way to check the status of another site? looking for ideas


slushpuppie

Recommended Posts

working on a project for a client where we copied a form onto our page which passes over to another domain. they want me to write something on my page though that can check the status of their server, make sure the page is active. and if it's not i'm supposed to hide my form and put up a message basically saying "out of order"...

 

they offered to put something on their page like a meta tag that either says "active" or "inactive" and want me to parse their page for this...

 

does anyone have a better idea? or anything? any input appreciated.

 

thanks!

Link to comment
Share on other sites

Damn dude I wrote something like this a whole back to have it check my primary server from a remote host.  If the connection took longer than 20 seconds it would fire off an SMS message to my cell phone.  Haha found it:

$fo = fsockopen('domain.com', 80);

if(!$fo)
{
	mail('email@email.com', 'site down', 'unable to connect on port 80 @ '.$date('H:m:s'));
}

 

I've seen some fancier stuff on phpclasses.org but I wanted something quick and dirty and thats exactly what this is.  You could use something like curl and use its functionality for the exact HTTP code if this is a web server, but anyways there are plenty of ways to skin this one.  Hope that works for you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.