Page 1 of 1

Test if Site is Online

Posted: Thu Sep 13, 2007 6:17 pm
by jeffery
How can I determine if a site is online.

I am building a payment gateway module for a framework and am trying to determine if the actual Gateway Provider is active. What functions can I utilise to determine the Gateway is reachable?

cheers,
Jeffery

Posted: Thu Sep 13, 2007 6:25 pm
by mrkite
try connecting to it with libcurl and a timeout set. If the connection times out... the site isn't up.

Posted: Thu Sep 13, 2007 8:05 pm
by jeffery
Thanks. I also came across fsockopen but I think curl is a better option.

Posted: Thu Sep 13, 2007 11:46 pm
by s.dot
This reminds me of a very very old class i made

Posted: Fri Sep 14, 2007 12:19 am
by jeffery
That looks good mate.. Will make use of it one day :)