Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 02-22-2008, 03:59 PM PHP Ping
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
I am seeking to ping a server from my webpage (also I own the server it's on)

Any suggestions on how to ping it and return a value of "Online", "Heavy Loaded" or "Offline" based on the returned values?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
 
Register now for full access!
Old 02-22-2008, 09:32 PM Re: PHP Ping
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
You can do a call to return a value from a specific page from the other server.

PHP Code:
<?php
  
  $handle 
= @fopen('http://www.domain.com/check_status.php''r');
  
  
$status = (int)@fread($handle1024);
  
  
  if (
$status == 1)
  {
    
// Server is online
  
}
  else
  {
    
// Server is offline
  
}
  
  @
fclose($handle);

There is a class written you can use to measure the server load in a percentage at http://www.phpclasses.org/browse/package/3109.html

Doing this, you could return a value of 2 or something if the load is above a threshold you set.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP Ping
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09582 seconds with 12 queries