Jump to content

Question

Posted

Guys i want to make l2server status (ONlLINE,OFFLINE) and set it on webiste of server
For Example When server is Offline to the website ... says OFFLINE 
When is Online to website say ONLINE !!!  How can i make this????

Photo Example :
 

post-139373-0-51202300-1401476424_thumb.png
 

 

post-139373-0-51202300-1401476424_thumb.png

9 answers to this question

Recommended Posts

  • 0
Posted (edited)

<?php
   $server_ip = "localhost";
   $loginserver_port = "7777";
   $gameserver_port = "2106";

   $login_status = @fsockopen( "$server_ip" , "$loginserver_port", $errno, $errstr, 0);
   $game_status = @fsockopen( "$server_ip" , "$gameserver_port", $errno, $errstr, 0);
   
              if($login_status){
      echo"Login:   Online<br />";
   }
   else{
      echo"Login::   Offline<br />";   
   }
   if($game_status){
      echo" Game:   Online<br />";
   }
   else{
      echo" Game:   Offline<br />";
   };
mysql_close($connect);
?>

Credits : Falcon

 

Login Server

<?php
    $status = @fsockopen("127.0.0.1", 2106, $errno, $errstr, 1);
if($status >= 1)
{ 
echo '<img src=images/on.png>';
}
else
{ 
echo '<img src=images/off.png>';
}

            ?>

Game Server

 

<?php
    $status = @fsockopen("127.0.0.1", 2106, $errno, $errstr, 1);
if($status >= 1)
{ 
echo '<img src=images/on.png>';
}
else
{ 
echo '<img src=images/off.png>';
}

            ?>

 

At <img src=images/on.png> replace with your image

Edited by FirefoxAurora
  • 0
Posted

man send me your skype name if you want to tell you something about this 

 

Just copy/paste the code in the html file and rename it from index.html to index.php and it will be fixed.

You won't be able to see results in your computer, you'll need to upload the website so you can see if it actually works.

Guest
This topic is now closed to further replies.


×
×
  • Create New...