Hello,
I was able to get this working perfectly on my localhost but soon as I upload it to my web server it does not work.
Does this only work on a localhost?
I have included all the php files.
Any help would be greatly appreciated.
Thanks
Alex
[syntax=php]
<?php
//checks if the given server is online.
function server_online($server, $port)
{
fsockopen($server, $port, $errno, $errstr, 0.1);
return($errno ===0);
}
?>
[/syntax]
[syntax=php]
<?php
$servers = array (
array('',''),
array('',''),
array('',''),
);
error_reporting(0);
include("/servers.inc.php");
?>
[/syntax]
[syntax=php]
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html" />
<meta name="author" content="lolkittens" />
<title>Untitled 4</title>
<style type="text/css">
table {width: 600px: border-collapse: collapse; }
td, th {padding: 4px; border: solid1px #444;}
.online {background: #090;}
.offline {background: #900;}
</style>
</head>
<body>
<div id="server">
<table>
<tr>
<th>Server</th>
<th>Status</th>
</tr>
<tbody>
<?php
require('includes/init.inc.php');
foreach ($servers as $server){
$online = server_online($server[0], $server[1]);
?>
<tr>
<td><?php echo $server[0], ':', $server[1]; ?></td>
<td class="<?php echo ($online) ? 'online':'offline'?>"><?php echo ($online) ? 'Online':'Offline'; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</body>
</html>
[/syntax]
Problems with server status page.
Re: Problems with server status page.
I believe it has to do with your host. They are probably blocking certain ports.
Try sending them an email saying you're trying to send data on those ports and they'll unlock them for you.
Try sending them an email saying you're trying to send data on those ports and they'll unlock them for you.
-
- Posts: 2
- Joined: Mon Sep 23, 2013 8:08 am
Re: Problems with server status page.
Ill send them a message.
Thank you for your help.
Alex
Thank you for your help.
Alex
Re: Problems with server status page.
If they can't help, feel free to come here again!