Simple function for displaying a few key elements of information regarding your server.
By : Matt
<?
//written by TDenholm (tim@radresource.net)
function server_stats() {
$server_software_get = getenv('SERVER_SOFTWARE');
$server_software = explode(" ", $server_software_get);
$server_name = getenv('SERVER_NAME');
$gateway_interface = getenv('GATEWAY_INTERFACE');
$server_protocol = getenv('SERVER_PROTOCOL');
$server_port = getenv('SERVER_PORT');
?>
<table border="0" cellspacing="0" bgcolor="#000000">
<tr>
<td><table border="0" cellspacing="0">
<tr>
<td colspan="2" bgcolor="#FF8000"><p
align="center"><font size="2" face="Verdana Ref"><strong>Server
Statistics</strong></font></p>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" valign="top"><font size="2"
face="Verdana Ref">Server Software:</font></td>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref">
<?
for ($i = 0; $i < count($server_software); $i++) {
echo $server_software[$i];
echo "<br>";
}
?>
</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref">Server Name:</font></td>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref"><?echo $server_name;?></font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref">Server Protocol:</font></td>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref"><?echo $server_protocol;?></font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref">Server Port:</font></td>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref"><?echo $server_port;?></font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref">Server CGI Revision:</font></td>
<td bgcolor="#FFFFFF"><font size="2"
face="Verdana Ref"><?echo $gateway_interface;?></font></td>
</tr>
</table>
</td>
</tr>
</table>
<?
}
?>
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.
More Counters Code Articles More By Codewalkers
Please enable JavaScript to view the comments powered by Disqus. blog comments powered by