Help and advice on my server status page...
Posted: Sun Apr 01, 2012 9:14 pm
ok i have recently used jaceks server status page tutorial... And i was wondering if anyone could help me make it where
when you see the servers, you can click the servers name and it will have their own custom page with info about it and the ability for people to post their own servers. please if anyone can help can they show me what i should do with codes to figure this out thank you.
here are my codes:
status.php:
when you see the servers, you can click the servers name and it will have their own custom page with info about it and the ability for people to post their own servers. please if anyone can help can they show me what i should do with codes to figure this out thank you.
here are my codes:
status.php:
<?php include('core/init.inc.php'); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> table { width: 600px; border-collapse: collapse; background: #fff; } td, th { padding: 4px; border: solid 1px #444; } .online { background: #090; } .offline { background: #900; } a { color: white; } </style> <title>Server Status</title> </head> <body background="ext/images/background.jpg"> <center> <?php if (fetch_user_rank() == 1) { // give permission echo '<a href="index.php"><img src="ext/images/home.jpg" width="93" height="27" alt=""></a><a href="admin.php"><img src="ext/images/admin.jpg" width="94" height="27" alt=""></a><a href="user_list.php"><img src="ext/images/members.jpg" width="134" height="27" alt=""></a><a href="status.php"><img src="ext/images/serverstatus.jpg" width="220" height="27" alt=""></a><a href="file_list.php"><img src="ext/images/files.jpg" width="76" height="27" alt=""></a><a href="edit_profile.php"><img src="ext/images/editprofile.jpg" width="176" height="27" alt=""></a><a href="logout.php"><img src="ext/images/logout.jpg" width="123" height="27" alt=""></a>'; } else { //redirect them echo '<a href="index.php"><img src="ext/images/home.jpg" width="93" height="27" alt=""></a><a href="user_list.php"><img src="ext/images/members.jpg" width="134" height="27" alt=""></a><a href="status.php"><img src="ext/images/serverstatus.jpg" width="220" height="27" alt=""></a><a href="file_list.php"><img src="ext/images/files.jpg" width="76" height="27" alt=""></a><a href="edit_profile.php"><img src="ext/images/editprofile.jpg" width="176" height="27" alt=""></a><a href="logout.php"><img src="ext/images/logout.jpg" width="123" height="27" alt=""></a>'; } ?><br /> <br /> <?php header("refresh:30;url=status.php"); echo '<font color="white">This page refreshes in about 30 secs. If not, click <a href="status.php">here</a>.</font>'; ?> </center><br /> <center><table> <thead> <tr> <th>Server IP</th> <th>Server Port</th> <th>Server Status</th> </tr> </thead> <tbody> <?php foreach ($servers as $server){ $online = server_online($server[0], $server[1]); ?> <tr> <td align="center"><?php echo $server[0]; ?></td> <td align="center"><?php echo $server[1]; ?></td> <td align="center" class="<?php echo ($online) ? 'online' : 'offline'; ?>"><?php echo ($online) ? 'Online' : 'Offline'; ?></td> </tr> <?php } ?> </tbody> </table></center> </body> </html>server.inc.php:
<?php // checks if server is online function server_online($server, $port){ fsockopen($server, $port, $errno, $errstr, 0.1); return ($errno === 0); } ?>init.inc.php:
$servers = array( array('127.0.0.1', '25586'), array('127.0.0.1', '43594'), array('127.0.0.1', '43594'), array('127.0.0.1', '43594'), );