Skip to content

L2 Server Status .... On Off On Webisite

Featured Replies

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

<?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

FirefoxAurora the Best :) 

  • Author

a last question ... i make it this with php code ... did you know how i make it with HTML Scripts?

 

you cant have scripts into html, just add the code there you need and save as .php that's all.

  • Author

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

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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.