Counters Code

  Home arrow Counters Code arrow server_stats()
COUNTERS CODE

server_stats()
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2002-04-08

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    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

    blog comments powered by Disqus

    COUNTERS CODE ARTICLES

    - TG Who's Online
    - Text Based Counter that formats output
    - Counter & visitor statistics
    - Server Uptime Statistics
    - Chris Dingman's Hit Tracker Script
    - Graph Maker Function
    - Simple userOnline class
    - Adv. Log file generator
    - Logwriter
    - time_left()
    - Basic Statistics
    - Easy Counter
    - countCodeLines
    - MySQL Counter
    - bandwidthmeter


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap