PHP Server Info

Discussion in 'Bukkit Help' started by thepluginbros, Jan 25, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    thepluginbros

    Hi,
    I'm trying to get server info from an php file but it says server offline everytime!
    My code:
    PHP:
    <?php
        
    require __DIR__ '/MinecraftQuery.class.php';
        
    $Query = new MinecraftQuery( );
     
        try {
            
    $Query->Connect'mc.hypixel.net'25565 );
            
    print_r$Query->GetInfo( ) );
            
    print_r$Query->GetPlayers( ) );
        } catch( 
    MinecraftQueryException $e ) {
            echo 
    '<font color=red>The server is Offline!</font>';
        }
    ?>
     
  2. Offline

    IanSzot

    I dont tested it, but this should work
    PHP:
    <?php
     
        
    include_once 'MinecraftServerStatus/status.class.php';
        
    $status = new MinecraftServerStatus();
        
    $response $status->getStatus('mc.hypixel.net'25565);
        if(!
    $response) {
            echo
    "The Server is offline!";
        } else {
            echo
    "The Server is Online"with ".$response['players']." online;
        }
     
    ?>
    Take a look at this http://forums.bukkit.org/threads/web-php-simple-to-use-minecraft-server-status-query.144329/
    It's very simple, and functional
     
  3. Offline

    Adriani6

    Wrong Section.
     
Thread Status:
Not open for further replies.

Share This Page