Php scripts

Results 1 to 5 of 5
  1. #1
    Imri Persiado tnrh1 is offline
    MemberRank
    May 2008 Join Date
    960Posts

    Php scripts

    hey.
    i rimember i saw that somewhere but i cant find it anymor.
    if anyone have link or the script him self please post it here thanks =]
    its the online/offline script
    and how many players online.


  2. #2
    Venture Adventure Tyler is offline
    LegendRank
    Nov 2008 Join Date
    United KingdomLocation
    4,441Posts

    Re: Php scripts

    PHP Code:
    <?php
    $ip 
    'IP HERE'//IP Varaible
    $port 'PORT HERE'//Port variable

    $fp = @fsockopen($ip,$port); //Trys to connect to IP/Port

    if ($fp){ // if statement (checks wether $fp connects)
    echo "<font color=\"green\">Online</font>"//Echos a message
    } else {
    echo 
    "<font color=\"red\">Offline</font>"//Echos a message
    }  ?>
    Hope that helps.

  3. #3
    Imri Persiado tnrh1 is offline
    MemberRank
    May 2008 Join Date
    960Posts

    Re: Php scripts

    thank you very much =]
    just the how many members online script i need

  4. #4
    Venture Adventure Tyler is offline
    LegendRank
    Nov 2008 Join Date
    United KingdomLocation
    4,441Posts

    Re: Php scripts

    This one is a little more complex.
    Correct me if I'm wrong, but this is the way I'd do it.

    You'll need a Database of somesort.
    A Connection to the database.
    And a field in the table with players online.
    When a player comes online, it changes the value +1 and offline -1.
    Just echo that field.

  5. #5
    Imri Persiado tnrh1 is offline
    MemberRank
    May 2008 Join Date
    960Posts

    Re: Php scripts

    that right.
    but i dont know how to wright it in PHP
    that why i ask you guys help =]



Advertisement