Already been released on this section.
|
This is really simple.
Now this is the code Just change add your IP and port if necessary.
Code:<?php function status() { $ip="Server IP"; $port="43594"; if(!$sock=@fsockopen($ip,"$port", $num, $error, 5)) { echo('Offline'); } else { echo('Online'); } } ?> <html> <body> <?php status(); ?> </body> </html>
Already been released on this section.
Just added it thanks, now how would I colour the online or offline? So say I want the online to be green and the offline to be red. Also, how would I change the font size...
echo('The server is <font color="red"> Offline');
} else {
echo('The server is <font color="green"> Online');
}
Dawn,
This is my code, yet when I add any random server ip the word online won't change. I tried random offline servers but it still said 'online'...
<?php
function status() {
$ip="208.64.120.82";
$port="43594";
if(!$sock=@fsockopen($ip,"$port", $num, $error, 5)) {
echo('<b><font color="cyan"><font size=14>The server is</b></font></font> <font color="orange"><font size=18>Online</font>');
} else {
echo('<b><font color="cyan"><font size=14>The server is</b></font></font> <font color="red"><font size=18>Offline</font>');
}
}
?>
Awesome1 you should make a help thread & nice release.
Already done by my but nice post, btw awesome try this,
Code:<?php function status() { $ip="208.64.120.82"; $port="43594"; if(!$sock=@fsockopen("$ip", $port, $num, $error, 5)) { echo('<b><font color="cyan" size=14>The server is</b></font> <font color="orange" size=18>Online</font>'); } else { echo('<b><font color="cyan" size=14>The server is</b></font> <font color="red" size=18>Offline</font>'); } } ?>
I don't understand why we need more of these. Stop, search around for the ones that are already here, and modify it for yourself. The last thing this section needs is more "server status checkers".
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |