Location: PHPKode > scripts > Server Status class > server-status-class/example1.php
<title>Server Status</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

include 'serverstatus.php';
	$test = new status;
	// Enable logging?
	$test->log = FALSE; // Default is false
	$test->AddService('localhost', 21, 'FTP', 'tcp');
	$test->AddService('localhost', 22, 'SSH', 'tcp');
	$test->AddService('localhost', 23, 'Telnet', 'tcp');
	$test->AddService('localhost', 25, 'SMTP', 'tcp');
	$test->AddService('localhost', 80, 'HTTP', 'tcp');
	$test->AddService('localhost', 110, 'POP3', 'tcp');
	$test->AddService('localhost', 3306, 'MySQL', 'tcp');
	$test->AddService('localhost', 2082, 'CPanel', 'tcp');
	$test->AddService('localhost', 2086, 'WHM', 'tcp');
	$data = $test->GetStatus();

<table width="50%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000">
  <tr align="center" bgcolor="#0066CC">
    <th colspan="3"><font color="#FFFFFF">Server Status</font></th>
  <tr align="center" valign="top" bgcolor="#666666">
    <th><font color="#FFFFFF">Host</font></th>
    <th><font color="#FFFFFF">Service</font></th>
    <th><font color="#FFFFFF">Status</font></th>
for($i = 0; $i <= count($data) - 1; $i++)
	$img = '<img src="on.gif" width=15 height=15>';
	$img = $on = '<font color="#00FF00" size="5">&#8226;</font>';
	$img = $off ='<font color="#FF0000" size="5">&#8226;</font>';
	// $img = '<img src="off.gif" width=15 height=15>';
  <tr align="center" valign="middle" bgcolor="#CCCCCC">
    <td align="left"><?php echo $data[$i]['ip']; ?></td>
    <td align="left"><?php echo $data[$i]['service']; ?></td>
    <td align="center"><?php echo $img; ?></td>
<div align="center">
<strong>Key:</strong> <?php echo $on; ?> means the
  service is up. <?php echo $off; ?> means the service
  isn't up.<BR><BR>
Return current item: Server Status class