Jump to content
  • 0

Server Status Checker


Question

6 answers to this question

Recommended Posts

  • 0
Posted

php script

<?php
    print'<table width="150">';
    $server  = "127.0.0.1";
    $portg   = "7777";
    $portl   = "9014";
    $timeout = "5";

    if ($server and $port and $timeout) {
        $game =  @fsockopen("$server", $portg, $errno, $errstr, $timeout);
        $login =  @fsockopen("$server", $portl, $errno, $errstr, $timeout);
    }
    print'<tr><td align="center"><strong>Server Status</strong></td></tr>';
    if($login) { print'<tr><td>Login:</td><td><font color="#00FF00"><strong> Online</strong></font><br><br></td></tr>'; }
    else { print'<tr><td>Login:</td><td><font color="#FF0000"><strong> Offline</strong></font><br><br></td></tr>'; }
    if($game) { print'<tr><td>Game:</td><td><font color="#00FF00"><strong> Online</strong></font></td></tr>'; }
    else { print'<tr><td>Game:</td><td"><font color="#FF0000"><strong> Offline</strong></td></tr>'; } 
    print'</table>';
?>

  • 0
Posted

<?php include "config/status.php" ?>
<?php

    //if ($server && $port && $timeout) {
        $game =  @fsockopen("$server", $portg, $errno, $errstr, $timeout);
        $login =  @fsockopen("$server", $portl, $errno, $errstr, $timeout);
    //}
    if($login) {
        echo "Login Server: <font color=#00DF00>Online</font><br />";
    }
    else {
        echo "Login Server: <font color=#FF0000>Offline</font><br />";
    }
    if($game) {
        echo "Game Server: <font color=#00DF00>Online</font><br />";
    }
    else {
        echo "Game Server: <font color=#FF0000>Offline</font><br />";
    }
    echo "";
?>

 

Then create new folder "config" and new file in it "status.php"

there replace that:

<?php
    $server  = "~> Server IP <~";
    $portg   = "7777";
    $portl   = "2106";
    $timeout = "1";
?>

  • 0
Posted

oo dude Im sorry I did not get your idea ...

I thing that you just whant a php script for your website :D

sorry .. but we cant help you in l2j develop area :D

some one move the topic to the right place ...

  • 0
Posted

php script

<?php
    print'<table width="150">';
    $server  = "127.0.0.1";
    $portg   = "7777";
    $portl   = "9014";
    $timeout = "5";

    if ($server and $port and $timeout) {
        $game =  @fsockopen("$server", $portg, $errno, $errstr, $timeout);
        $login =  @fsockopen("$server", $portl, $errno, $errstr, $timeout);
    }
    print'<tr><td align="center"><strong>Server Status</strong></td></tr>';
    if($login) { print'<tr><td>Login:</td><td><font color="#00FF00"><strong> Online</strong></font><br><br></td></tr>'; }
    else { print'<tr><td>Login:</td><td><font color="#FF0000"><strong> Offline</strong></font><br><br></td></tr>'; }
    if($game) { print'<tr><td>Game:</td><td><font color="#00FF00"><strong> Online</strong></font></td></tr>'; }
    else { print'<tr><td>Game:</td><td"><font color="#FF0000"><strong> Offline</strong></td></tr>'; } 
    print'</table>';
?>

 

rofl i wrote that 3 years ago and its still spreading xD

 

thanks but how guest must write serveri ip?

 

google "submiting php forms"... i promise its really easy..

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...