Click to See Complete Forum and Search --> : IFRAME Verify


Jimbo2150
05-23-2003, 01:50 PM
Is ther a way to use JavaScript to verify a connection (check to see if a server is up or down)?

Here is my situation:

I have a website hosted on a server that doesnt support PHP (other servers cost too much at the moment).
I have my own server with PHP and MySQL servers, but only want to use it for a small portion of my site.
I have an IFRAME linking to my server on the website.
I would like to (if possible) verify that my server is up before linking the IFRAME to it.

RUNDOWN:
WEBSITE SERVER(NO PHP) -> IFRAME in SITE -> Verify connection to my server (Is it up or not?) -> IF SERVER IS UP display page in IFRAME -> IF NOT, display a message 'SERVER IS NOT UP'

I was hoping to link the IFRAME if the server is up, and if not display a message in the IFRAME stating that the server is not running.

Is it possible with JavaScript? VBScript?
I would use PHP but as I said the server it is running from doesnt support it. Only my server does.

khalidali63
05-23-2003, 01:59 PM
The straight forward answer is "No"
However you can use a hack that is used to validate if images are loadable or not...

check this link out..

http://68.145.35.86/skills/javascripts/FindOutAServerIsUp.html

koeniepoenie
05-24-2003, 02:40 PM
interesting script is that..

Jona
05-24-2003, 02:52 PM
Originally posted by Jimbo2150
I would use PHP but as I said the server it is running from doesnt support it. Only my server does.

I wouldn't use PHP. You can use it, but using Perl to Ping the server is the best (and most reliable) way.

khalidali63
05-24-2003, 03:09 PM
Originally posted by koeniepoenie
interesting script is that..

:D

You think so..

Thanks

koeniepoenie
05-24-2003, 03:31 PM
did you write the script?
i really love jscript and i write a lot of things in JS :)
I think the author did really well on this script (I hope this is correct English :))
grtz Koen