Location: PHPKode > scripts > Soldat Server Stats > soldat-server-stats/examples/normal.php
<?php

require ("../SoldatServer.php");

$server = new SoldatServer("YOUR SERVER IP");

?>
<html>
<head>
	<link title="style" type="text/css" rel="stylesheet" href="main.css" />
</head>
<body>
<?php if ($server->queryServer() !== FALSE): ?>

<div class="server_name"><?php echo $server->getName(); ?> (<?php echo $server->getVersion(); ?>)</div>
<div class="map_image">
	<img src="images/<?php echo (file_exists('images/' . strtolower($server->getMap()) . '.jpg')) ? strtolower($server->getMap()) . '.jpg' : 'default.jpg'; ?>" alt="<?php echo $server->getMap(); ?>" />
</div>

<table class="stats" width="380">
	<tr>
		<th colspan="2" style="text-align: center">Server details</td>
	</tr>
	<tr>
		<th>Address:</td>
		<td><?php echo $server->getIp(); ?>:<?php echo $server->getPort(); ?></td>
	</tr>
	<tr>
		<th>Players:</td>
		<td><?php echo $server->getPlayerCount(); ?> / <?php echo $server->getMaxPlayers(); ?></td>
	</tr>
	<tr>
		<th>Ping:</td>
		<td><?php echo $server->getPing(); ?></td>
	</tr>
	<tr>
		<th>Gametype:</td>
		<td><?php echo $server->getGametype(); ?></td>
	</tr>
	<tr>
		<th>Map:</td>
		<td><?php echo $server->getMap(); ?></td>
	</tr>
	<tr>
		<th>Rules:</th>
		<td>
			<select style="width: 200px">
			<?php foreach ($server->getRules() as $key => $value): ?>
				<option><?php echo $key; ?>: <?php echo $value; ?></option>
			<?php endforeach; ?>
			</select>
		</td>
	</tr>
</table>
<br />
<table class="stats" width="380">
	<tr>
		<th>Name</td>
		<th>Score</td>
		<th>Ping</td>
		<th>Time</td>
	</tr>
	<?php foreach ($server->getPlayers() as $player): ?>
	<tr>
		<td><?php echo $player->getName(); ?></td>
		<td><?php echo $player->getScore(); ?></td>
		<td><?php echo $player->getPing(); ?> ms</td>
		<td><?php echo $player->getTime(); ?> m</td>
	</tr>
	<?php endforeach; ?>
</table>
<?php else: ?>
	<p>Couldn't query the server</p>
<?php endif; ?>
</body>
</html>
Return current item: Soldat Server Stats