- Joined
- Feb 28, 2007
- Messages
- 446
- Reaction score
- 5
Status.php
Demo :
Server IP Address - Please Change this for the script to work.
Online / Offline Images - Make sure the URL matches they location where they are located.
For the sake of Locolijo having a Period , I Dont take credits for this.
Demo :
To view the content, you need to sign in or register
PHP:
<?php
//Page Variables
$online='<td><img src="http://on.gif"/></td>';
$offline='<td><img src="http://off.gif"/></td>';
//Functions
function servercheck($server,$port){
//Check that the port value is not empty
if(empty($port)){
$port=80;
}
//Check that the server value is not empty
if(empty($server)){
$server='localhost';
}
//Connection
$fp=@fsockopen($server, $port, $errno, $errstr, 1);
//Check if connection is present
if($fp){
//Return Alive
return 1;
} else{
//Return Dead
return 0;
}
//Close Connection
fclose($fp);
}
//Ports and Services to check
$services=array(
'' => array('xx.xxx.xxx.xxx' => 8484),
);
?>
<table>
<?php
//Check All Services
foreach($services as $name => $server){
?>
<tr>
<td><?php echo $name; ?></td>
<?php
foreach($server as $host => $port){
if(servercheck($host,$port)){ echo $online; }else{ echo $offline; }
}
?>
</tr>
<?php
}
?>
Code:
('xx.xxx.xxx.xxx' =>
Code:
http://on.gif
http://off.gif
For the sake of Locolijo having a Period , I Dont take credits for this.

