Question I have a Question !♥

Discussion in 'PHP' started by SulimanAbdulaziz, Jul 7, 2016.

  1. Hello everyone, I am a small programmer in PHP
    I want to help everyone that it is extracted UUID + CLIENT NAME from IP
    How ? How?

    Sorry But my language the english is bad xD
    ♥ Thank You ♥
     
    tiro likes this.
  2. timodohmen

    timodohmen Active Member

    I think you ask how you can find out the Client name and UID from the users ÌP Rigth?
     
    SulimanAbdulaziz likes this.
  3. yeah, see this
    http://prntscr.com/bq1xee
     
  4. timodohmen

    timodohmen Active Member

    SulimanAbdulaziz likes this.
  5. Alligatoras

    Alligatoras Super Mod

    You can always use the Welcome Function from the JTS3 Server Mod!
    Download Link: Click Here
     
    SulimanAbdulaziz likes this.
  6. timodohmen

    timodohmen Active Member

    SulimanAbdulaziz likes this.
  7. No, i want code php(frameowork)
     
  8. timodohmen

    timodohmen Active Member

    Dude we doesn't understand want you want from us ? ahhh men....
     
  9. Sorry But my language the english is bad xD
    i want create bot in my server, i using framework
    I need code show name client + uuid in web panel
     
  10. tiro

    tiro Member

    You mean to recognize client automatically, without put UUID or nickname
     
    SulimanAbdulaziz likes this.
  11. Alligatoras

    Alligatoras Super Mod

    What he actually needs it to add to his website a box that says: Welcome (TeamspeakUser) and the Teamspeak User will be changed with the user's name based his IP Address!
     
    SulimanAbdulaziz likes this.
  12. Patrick

    Patrick New Member

    PHP:

    $user 
    'serveradmin';
    $password '12345';
    $ip_query '127.0.0.1';
    $port '9987';

    try {
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://$user:$password@$ip_query/?server_port=$port&nickname=GetNameByIP");

    foreach (
    $ts3_VirtualServer->clientList() as $cl) {
                    if (
    $cl->client_type) continue;
                    if (
    $cl->getProperty('connection_client_ip') == $_SERVER['REMOTE_ADDR']) {
                            
    $result[] = $cl->client_nickname;
                            
    $uid $cl->client_unique_identifier;
                    }
            }
    }
    catch (
    Exception $e) {
            echo 
    "<p class='error'><b>Error " $e->getCode() . ":</b> " $e->getMessage() . "</p>";
            die;
    }


    if (
    $result == "" ) {
    exit;
    }

    echo 
    "Welcome To Our Server" implode(', '$result) . "<br>";
    echo 
    "Your ID: " $uid;

     
    Last edited by a moderator: Jul 8, 2016
  13. I want to show the name client + UID in my website
    http://prntscr.com/bq5nb4
    Example:
    Welcome To Our Server ($Name_Client)
    Your ID ($UID_Client
     
  14. Nicer

    Nicer Contributing Member

    Here ya go:
    PHP:
    require_once("libraries/TeamSpeak3/TeamSpeak3.php");
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://USERNAME:[email protected]:10011/?server_port=9987");
    $clientip $_SERVER['REMOTE_ADDR'];
    $nickname = array();
    $uid = array();
    foreach(
    $ts3_VirtualServer->clientListDb() as $Client)
    {
        if(
    $Client['client_lastip'] == $clientip)
        {
            
    $nickname[] = $Client['client_nickname'];
            
    $uid[] = $Client['client_unique_identifier'];
        }
     

    }

    if(
    $nickname[0] == "") { $nickname[0] = "New member"$uid[0] = "New meber"; }

    echo 
    "Name: " $nickname[0];
    echo 
    "<br/>";
    echo 
    "UID: " $uid[0];
    It prints first connected client with that ip.
     
    Last edited: Jul 8, 2016
    tiro likes this.
  15. Tell me

    Notice: Undefined offset: 0 in D:\My-Servers\xampp\htdocs\SkyLayerBots\inc\source.php on line 21
    Name:

    Notice: Undefined offset: 0 in D:\My-Servers\xampp\htdocs\SkyLayerBots\inc\source.php on line 23
    UID:
     
  16. Nicer

    Nicer Contributing Member

    That means nobody matches the ip.

    EDIT: Slightly edited the script (if nobody matches with any ip, it will print New member)
     
    Last edited: Jul 8, 2016
  17. Thank you, i have a question, how to display name a group
    example:http://prntscr.com/bq62x9
     
  18. Nicer

    Nicer Contributing Member

    I'll take a look at it tomorrow.

    EDIT: Still didn't figure hw to do it :D
     
    Last edited: Jul 8, 2016
  19. EscuderoKevin

    EscuderoKevin Active Member


    You need to register to view spoilers!
     
    SulimanAbdulaziz and tiro like this.

Share This Page