my server check - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: my server check (
/showthread.php?tid=83684)
my server check -
sa-mp24 - 26.06.2009
hello dudes,
i've wrote a simple server check in php, but it works just sometimes on my root.
Code:
<?
$ip = 'my local IP';
$port = "my port";
$fp = @fsockopen('udp://' . $ip, $port, $errno, $errstr);
if (!$fp)
{
echo "<br><br><div class='offline'><img src='media/offline.png' alt='offline' /> Samp <font color='#FF0000'><b>offline</b><br></font></ br> </ br></div>";
}
else
{
echo "<br><br><div class='online'> <img src='media/online.png' alt='online' /> <b> Samp <font color='#009900'>online</font> IP: $sampip : $sampport <br></div>";
}
?>