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

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

$server = new TeeWorldsServer("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/' . $server->getMap() . '.jpg')) ? $server->getMap() . '.jpg' : 'default.jpg'; ?>" alt="<?php echo $server->getMap(); ?>" />
</div>

<table class="stats" width="350">
	<tr>
		<th colspan="2">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>Gametype:</td>
		<td><?php echo $server->getGametype(); ?></td>
	</tr>
	<tr>
		<th>Map:</td>
		<td><?php echo $server->getMap(); ?></td>
	</tr>
	<tr>
		<th>Ping:</td>
		<td><?php echo $server->getPing(); ?></td>
	</tr>
</table>
<br />
<table class="stats" width="350">
	<tr>
		<th>Name</td>
		<th>Score</td>
	</tr>
	<?php foreach ($server->getPlayers() as $player): ?>
	<tr>
		<td><?php echo $player->getName(); ?></td>
		<td><?php echo $player->getScore(); ?></td>
	</tr>
	<?php endforeach; ?>
</table>
<?php else: ?>
	<p>Couldn't query the server</p>
<?php endif; ?>
</body>
</html>
Return current item: TeeWorlds Server Stats