Server Status

Results 1 to 11 of 11
  1. #1
    Banned Requnael is offline
    BannedRank
    Apr 2009 Join Date
    EstoniaLocation
    378Posts

    Server Status

    PHP Code:
    <?php
    $srvip 
    "127.0.0.1"//Input WanIP
    $srvport "6000"//Port
    $dns="GunzDB";
    $user="SA";
    $pass=""//Input Password Here
    $connect=odbc_connect($dns$user$pass) or die ("Couldn't connect to the database, we're sorry...");
    odbc_exec($connect,"use GunzDB");
    ?>
      <tr>
        <td align="right">Server Status: </td>
        <td><?php 
    $fp 
    = @fsockopen($srvip$srvport$errno$errstr1);
    if (!
    $fp) {
        echo 
    "<font style='color: #FF3300'><B>Offline</B></font></br>";
    } else {
        echo 
    "<font style='color: #009933'><B>Online</B></font></br>";
        
    fclose($fp);
    ?></td>
      </tr>

    How to i can add here "Players Online" ??


  2. #2
    Account Upgraded | Title Enabled! Aiona is offline
    MemberRank
    Feb 2008 Join Date
    The NetherlandsLocation
    232Posts

    Re: Server Status

    add

    Code:
     $query01 = odbc_exec($connect, "SELECT * FROM ServerStatus");
    	
    	odbc_fetch_row($query01);
    	$CurrPlayer = odbc_result($query01, 2);
    	$MaxPlayer = odbc_result($query01, 3);

  3. #3
    Banned Requnael is offline
    BannedRank
    Apr 2009 Join Date
    EstoniaLocation
    378Posts

    Re: Server Status

    Quote Originally Posted by mugodz007 View Post
    add

    Code:
     $query01 = odbc_exec($connect, "SELECT * FROM ServerStatus");
    	
    	odbc_fetch_row($query01);
    	$CurrPlayer = odbc_result($query01, 2);
    	$MaxPlayer = odbc_result($query01, 3);
    PHP Code:
    <?php
    $srvip 
    "127.0.0.1"//Input WanIP
    $srvport "6000"//Port
    $dns="GunzDB";
    $user="SA";
    $pass=""//Input Password Here
    $connect=odbc_connect($dns$user$pass) or die ("Couldn't connect to the database, we're sorry...");
    odbc_exec($connect,"use GunzDB");
    ?>
      <tr>
        <td align="right">Server Status: </td>
        <td><?php 
    $fp 
    = @fsockopen($srvip$srvport$errno$errstr1);
    if (!
    $fp) {
        echo 
    "<font style='color: #FF3300'><B>Offline</B></font></br>";
    } else {
        echo 
    "<font style='color: #009933'><B>Online</B></font></br>";
        
    fclose($fp);




     
    $query01 odbc_exec($connect"SELECT * FROM ServerStatus");
        
        
    odbc_fetch_row($query01);
        
    $CurrPlayer odbc_result($query012);
        
    $MaxPlayer odbc_result($query013);





    ?>
    Right? and this is not works!

  4. #4
    Account Upgraded | Title Enabled! lDonatorl is offline
    MemberRank
    Sep 2009 Join Date
    FranceLocation
    272Posts

    Re: Server Status

    First OF AlL Hi
    ------------------

    -------------------------------------------------
    i am here for helping you, i read and i found for your Request

    Original thread:
    >Server status - working

    Method
    : PHp
    regards.
    -------------------------------------------------------------------------------------

    use this

    Code:
    <?Php
    $sip = "YOUR IP";
    $sport2 = "8900";
    $sport3 = "7777";
    $title = "UGN - small status";
    if(realm_status($sip, $sport2) === false)
    {
    echo "<font style='color: #FF3300'><B>PG QuesT Server</B></font></br>";
    }
    elseif(realm_status($sip, $sport2) === true)
    {
    echo "<font style='color: #009933'><B>PG QuesT Server</B></font></br>";
    }
    else
    {
    echo "<font style='color: #FF3300'><B>PG QuesT Server</B></font></br>";
    }
    ?><br>
    <?php
    if(realm_status($sip, $sport3) === false)
    {
    echo "<font style='color: #FF3300'><B>PG CLan Server</B></font></br>";
    }
    elseif(realm_status($sip, $sport3) === true)
    {
    echo "<font style='color: #009933'><B>PG CLan Server</B></font></br>";
    }
    else
    {
    echo "<font style='color: #FF3300'><B>PG CLan Server</B></font></br>";
    }
    function realm_status($host, $port)
    {
    error_reporting(0);
    $etat = fsockopen($host,$port,$errno,$errstr,3);
    if(!$etat)
    {
    return false;
    }
    else
    {
    return true;
    }
    }
    
    ?>
    Last edited by lDonatorl; 23-01-11 at 12:18 PM.

  5. #5
    Banned Requnael is offline
    BannedRank
    Apr 2009 Join Date
    EstoniaLocation
    378Posts

    Re: Server Status

    Quote Originally Posted by lDonatorl View Post
    use this

    Code:
    <?Php
    $sip = "YOUR IP";
    $sport2 = "8900";
    $sport3 = "7777";
    $title = "UGN - small status";
    if(realm_status($sip, $sport2) === false)
    {
    echo "<font style='color: #FF3300'><B>PG QuesT Server</B></font></br>";
    }
    elseif(realm_status($sip, $sport2) === true)
    {
    echo "<font style='color: #009933'><B>PG QuesT Server</B></font></br>";
    }
    else
    {
    echo "<font style='color: #FF3300'><B>PG QuesT Server</B></font></br>";
    }
    ?><br>
    <?php
    if(realm_status($sip, $sport3) === false)
    {
    echo "<font style='color: #FF3300'><B>PG CLan Server</B></font></br>";
    }
    elseif(realm_status($sip, $sport3) === true)
    {
    echo "<font style='color: #009933'><B>PG CLan Server</B></font></br>";
    }
    else
    {
    echo "<font style='color: #FF3300'><B>PG CLan Server</B></font></br>";
    }
    function realm_status($host, $port)
    {
    error_reporting(0);
    $etat = fsockopen($host,$port,$errno,$errstr,3);
    if(!$etat)
    {
    return false;
    }
    else
    {
    return true;
    }
    }
    
    ?>

    Ehm, i need Status server with status players..

  6. #6
    Account Upgraded | Title Enabled! lDonatorl is offline
    MemberRank
    Sep 2009 Join Date
    FranceLocation
    272Posts

    Re: Server Status

    Ok enjoy.

    Download in Attachments
    Attached Files Attached Files

  7. #7
    Banned Requnael is offline
    BannedRank
    Apr 2009 Join Date
    EstoniaLocation
    378Posts

    Re: Server Status

    Quote Originally Posted by lDonatorl View Post
    Ok enjoy.

    Download in Attachments


    Ehm, can you put player online here


    PHP Code:
    <?php
    $srvip 
    "127.0.0.1"//Input WanIP
    $srvport "6000"//Port
    $dns="GunzDB";
    $user="SA";
    $pass=""//Input Password Here
    $connect=odbc_connect($dns$user$pass) or die ("Couldn't connect to the database, we're sorry...");
    odbc_exec($connect,"use GunzDB");
    ?>
      <tr>
        <td align="right">Server Status: </td>
        <td><?php 
    $fp 
    = @fsockopen($srvip$srvport$errno$errstr1);
    if (!
    $fp) {
        echo 
    "<font style='color: #FF3300'><B>Offline</B></font></br>";
    } else {
        echo 
    "<font style='color: #009933'><B>Online</B></font></br>";
        
    fclose($fp);
    ?></td>
      </tr>

    Please.
    Last edited by Requnael; 23-01-11 at 12:56 PM.

  8. #8
    Account Upgraded | Title Enabled! lDonatorl is offline
    MemberRank
    Sep 2009 Join Date
    FranceLocation
    272Posts

    Re: Server Status

    Ok added 'ALL IN ONE'

    Code:
    <?php
    $srvip = "YoUR IP"; //Input WanIP
    $srvport = "6000"; //Port
    $dns="GunzDB";
    $user="sa";
    $pass="your SQL Password"; //Input Password Here
    $connect=odbc_connect($dns, $user, $pass) or die ("Couldn't connect to the database, we're sorry...");
    odbc_exec($connect,"use GunzDB");
    ?>
      <tr>
        <td align="right">Server Status: </td>
        <td><?php 
    $fp = @fsockopen($srvip, $srvport, $errno, $errstr, 1);
    if (!$fp) {
        echo "<font style='color: #FF3300'><B>Offline</B></font></br>";
    } else {
        echo "<font style='color: #009933'><B>Online</B></font></br>";
        fclose($fp);
    } ?></td>
      </tr>
      <?php
    $_MSSQL[Host]   = "PC-DE-IEXLDESIG";    
    $_MSSQL[User]   = "sa";                     
    $_MSSQL[Pass]   = "Your SQL Password";                       
    $_MSSQL[DBNa]   = "GunzDB";                 
    function connect()
    {
        global $_MSSQL;
    
        $resource = odbc_connect("Driver={SQL Server};Server={$_MSSQL[Host]}; Database={$_MSSQL[DBNa]}", $_MSSQL[User], $_MSSQL[Pass]) or die(odbc_errormsg());
        return $resource;
    }
    
    $connection = connect();
    
    $CharTable     = "dbo.Character";
    ?>
      <?Php
     //Configuration file
    //Server STATUS
    $fucku1 = odbc_exec($connection, "SELECT COUNT(*) FROM dbo.Account");
    $fucku2 = odbc_exec($connection, "SELECT COUNT(*) FROM dbo.Character");
    $fucku3 = odbc_exec($connection, "SELECT * FROM dbo.ServerStatus");
    $fucku4 = odbc_exec($connection, "SELECT * FROM dbo.Character order by RegDate Desc");
    
     for($i=0;$i < odbc_num_rows($fucku1);++$i)
    {
    odbc_fetch_row($query);
    $lawl = $i+1;
    
    echo "<font style='color: #00BFFF'><B>Player online:</B></font></br>"; //Chose your titl name
    echo odbc_result($fucku3, 1);
    }
    ?>
    i hope you like it :P
    Attached Files Attached Files
    Last edited by lDonatorl; 23-01-11 at 01:10 PM.

  9. #9
    Banned Requnael is offline
    BannedRank
    Apr 2009 Join Date
    EstoniaLocation
    378Posts

    Re: Server Status

    still don't work :D

  10. #10
    Account Upgraded | Title Enabled! lDonatorl is offline
    MemberRank
    Sep 2009 Join Date
    FranceLocation
    272Posts

    Re: Server Status

    Quote Originally Posted by Requnael View Post
    still don't work :D
    i tryed it and its working O.o what is your hoster ? ( xampp,easyphp,appserver.other ) ?

  11. #11
    Banned Requnael is offline
    BannedRank
    Apr 2009 Join Date
    EstoniaLocation
    378Posts

    Re: Server Status

    xampp.. He showing all times 1 ppls..



Advertisement