943,864 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 498
  • PHP RSS
Feb 9th, 2009
0

server uptime application

Expand Post »
anyone can help mo to tell the algorithm how to make server uptime application like serveruptime.com?

http://www.duniaislam.site50.net
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
forzadraco is offline Offline
70 posts
since Mar 2008
Feb 9th, 2009
0

Re: server uptime application

Hi Darco,

I assume you're after the PHP function you'd use for checking whether a server is up (the rest will just be a database of the sites you're monitoring).

Personally, I'd probably about it with a socket_connect call, that should be able to confirm a connection existing to an address, which I guess is all you are looking to confirm.
Reputation Points: 10
Solved Threads: 1
Light Poster
BeachyUK is offline Offline
32 posts
since May 2006
Feb 9th, 2009
0

Re: server uptime application

Actually, thinking it through, perhaps I'd go with something more like this... If you wanted to, you could read the contents of the URL, though I imagine you just want an UP or DOWN decision, I think the below would do the trick.

PHP Syntax (Toggle Plain Text)
  1. $cn = fsockopen ('http://www.daniweb.com', 443, $errnum, $errdesc, 30);
  2.  
  3. if (!$cn) {
  4. // Can't Connect to URL
  5. $sitestatus="DOWN";
  6. }else{
  7. // Connected fine - URL works
  8. $sitestatus="UP";
  9. }
Reputation Points: 10
Solved Threads: 1
Light Poster
BeachyUK is offline Offline
32 posts
since May 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: pop up window
Next Thread in PHP Forum Timeline: comment function





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC