Results 1 to 4 of 4

Thread: Status Script

  1. #1
    Join Date
    Aug 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Status Script

    Hello everyone!

    If someone know how i can make a GameServer/LoginServer Status shower script through Port and IP please tell me! or if there is already a such!

    For Example:

    GS(GameServer): Online (If the server is offline i want it to show Offline)
    LS(LoginServer): Online (If the server is offline i want it to show Offline)

    Thanks everyone in advance!!!

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    You could use many different techniques for this. One of the most frequently used methods is by using PHP's fsockopen() function to try to connect to the server. This would look something like the following:

    Code:
    <?php
     $GS = fsockopen("www.gameserver.com", 80, $errno, $errstr, 30);
     $LS = fsockopen("www.loginServer.com", 80, $errno, $errstr, 30);
    
     if (!$GS) { $GS_stat = 'Offline'; }
     else { $GS_stat = 'Online'; }
    
     if (!$LS) { $LS_stat = 'Offline'; }
     else { $LS_stat = 'Online'; }
    ?>
    Game Server Status:  <?php echo $GS_stat;?> <br>
    Login Server Status:  <?php echo $LS_stat;?>
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Aug 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have one question. Can i use it on HTML? Or i can just recreate the HTML file into PHP and inser this code.

    Well sorry but i dont know much for those languages!

  4. #4
    Join Date
    Aug 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by thetestingsite View Post
    You could use many different techniques for this. One of the most frequently used methods is by using PHP's fsockopen() function to try to connect to the server. This would look something like the following:

    Code:
    <?php
     $GS = fsockopen("www.gameserver.com", 80, $errno, $errstr, 30);
     $LS = fsockopen("www.loginServer.com", 80, $errno, $errstr, 30);
    
     if (!$GS) { $GS_stat = 'Offline'; }
     else { $GS_stat = 'Online'; }
    
     if (!$LS) { $LS_stat = 'Offline'; }
     else { $LS_stat = 'Online'; }
    ?>
    Game Server Status:  <?php echo $GS_stat;?> <br>
    Login Server Status:  <?php echo $LS_stat;?>
    Hope this helps.
    Okay i made it! Thanks very much for the help!!!!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •