Hi Iv been running a really big MMORPG server on many computers. The way I show that there online I use the fallowing
<b>Ordway</b></a>- <?php
@$fp = fsockopen ("blabla.ath.cx",7171, $errno, $errstr, 1);
if (!$fp) {
print("Offline"
);}else{ print("Online
");
fclose($fp);
} ?>
Now many know this isnt a good idea if you have more then one server listed on one site. The reason for this is becuse the site loads hell alot slower. So I need some help thats why I came here.
I need someone to help me add in a cronjob or a fsock timer of some kind. So that the servers are looked up every 4 mins to see if there on then save the datetime to a text file and then look up the servers 4 mins later.
I dont know how to code this in to the current source I have on my site. Heres what I have on my site.
<a href="ordway.php"><b>Ordway</b></a>- <?php
@$fp = fsockopen ("blabla.ath.cx",7171, $errno, $errstr, 1);
if (!$fp) {
print("Offline"
);}else{ print("Online
");
fclose($fp);
} ?><br>
<a href="vidv.php"><b>Vidvaouko</b></a>- <?php
@$fp = fsockopen ("Vidvaouko.mine.nu",7171, $errno, $errstr, 1);
if (!$fp) {
print("Offline"
);}else{ print("Online
");
fclose($fp);
} ?><br>
<a href="sonia.php"><b>Sonia</b></a>- <?php
@$fp = fsockopen ("Sonia.kicks-ass.net",7171, $errno, $errstr, 1);
if (!$fp) {
print("Offline");}else{ print("Online");
fclose($fp);
} ?>
<br>
<a href="stone.php"><b>stonedhawk</b></a>- <?php
@$fp = fsockopen ("stonedhawk.no-ip.info",7171, $errno, $errstr, 1);
if (!$fp) {
print("Offline");}else{ print("Online");
fclose($fp);
} ?>
Much thanks to whoever helps me on this.