PHP Classes

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of William Lang  >  Call of Duty 4 Server Status  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example
Class: Call of Duty 4 Server Status
Retrieve information from COD4 game server
Author: By
Last change: added mapname
Date: 7 years ago
Size: 1,863 bytes


Class file image Download
$status = new COD4ServerStatus('', '28960');
    if (
$serverStatus = $status->returnServerData();
$players = $status->returnPlayers();
$pings = $status->returnPings();
$scores = $status->returnScores();
<h1>Server: <? echo $serverStatus['sv_hostname'];?></h1>
            Admin: <? echo $serverStatus['_Admin'];?><br />
            Email: <? echo $serverStatus['_Email'];?><br />
            IRC: <? echo $serverStatus['Irc'];?><br />
            Location: <? echo $serverStatus['_Location']; ?><br />
            Website: <a href="http://<? echo $serverStatus['_Website']; ?>">http://<? echo $serverStatus['_Website']; ?></a><br /><br />

            <table width="50%" cellspacing="1" cellpadding="1" border="1">
                    <td style="border:0px;" colspan="4">
                        <img src="img<? echo $serverStatus['mapname']; ?>.jpg" alt="<? echo $serverStatus['mapname']; ?>" align="left" style="margin-right:10px;" />
                        <h3><? echo $serverStatus['mapname']; ?></h3>
                    <th width="5%">#</th>
                    <th width="15%">Score</th>
                    <th width="15%">Ping (ms)</th>
= 1;
$players as $i => $v){
                    <td><? echo $rank; ?></td>
                    <td><? echo $players[$i]; ?></td>
                    <td><? echo $scores[$i]; ?></td>
                    <td><? echo $pings[$i]; ?></td>