Click to See Complete Forum and Search --> : How to Show if Server is Online or Offline?


dandino
11-15-2003, 07:48 AM
Hi all

I have a web page on my ISP's server that has a link to my own private server. My ISP's server is always online, but my private server only sometimes.
I would like to somehow visualy indicate on my webpage whether my private server is online or off. Maybe a green light indicator for online and a red one for off.

My question therefore is this: is there some way using HTML or maybe Javascript that the link to my private server can be checked to establish if it is on or offline, and then to display the result accordingly as my page loads so that anyone visiting can instantly see my server's status? I'm sure there must be a way, in fact I think Iv'e seen this sort of thing on the net somewhere.

If someone knows if this is possible or how to do it, would you please let me know - maybe even a snippet of code

Any help greatly appreciated
Dan Hawkes

Khalid Ali
11-15-2003, 07:56 AM
if you wnt to use javascript to get this done,you can use imag objects onerror event....

Check this resource for details (http://www.webapplikations.com/pages/html_js/document/FindOutAServerIsUp.html)

Edit
If you have access to server side programming there will be a variety of tools you can use then.

dandino
11-15-2003, 08:08 AM
Hi Khalid Ali

Thanks very much for that link however I don't think it will work in my case because my private server is password protected (it has to be because it's on my PC) and therefore I don't think it will check for an image without a password.

Is there some other way I can a cheive this?