Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 4 of 4
  1. #1
    Join Date
    January 2014
    Location
    Longuich
    Posts
    10

    Unhappy Server Status offline ?!

    Hello World,

    i have code a php script.

    The problem is, the script say all server offline but i can join on this server.
    The TeamSpeak process is runnig on the server perfectly.
    Why say me the script the Server offline?!?!
    The Data was all correct, i tested it by myself!

    PHP Code:
    <?php
    $db1 
    mysql_connect("*****""******""****")
    or die(
    "Verbindung zur Datenbank konnte nicht hergestellt werden");

    mysql_select_db("db405597_17"$db1) or die ("Datenbank konnte nicht ausgewählt werden");

    $serverdatendb "SELECT * FROM serverdaten WHERE id=1";

    $dosearch1 mysql_query($serverdatendb$db1);
    $test1[email protected]mysql_fetch_row($dosearch1);


    $id $test1[0];
    $user $test1[1];
    $pass $test1[2];
    $port $test1[3];
    $ip $test1[4];


    require_once(
    "simpletstelnet.php");
    $telnet = new SimpleTSTelnet("$ip"$port"serveradmin""$pass");

    $result $telnet->TSConnect();
    if (
    $result)
    {
        
    $result $telnet->TSLogin();
        if (
    $result)
        {
            
    $serverList $telnet->GetList("serverlist");
            
    print_r($serverList);


            foreach (
    $serverList as $serverEntry)
            {
                
    //echo "Name: <b>".$serverEntry["virtualserver_name"]."</b> Port: <b>".$serverEntry["virtualserver_port"]."</b> <br>";

                
                
    $slotsdb "SELECT slots FROM server WHERE serverport=".$serverEntry["virtualserver_port"]." AND serverip='$ip'";
                
    $dosearch mysql_query($slotsdb$db1);
                
    $test2=mysql_result($dosearch,0);

                
    //echo "Angegebene Slots bei Bestellung: ";
                //echo $test2;
                //echo "<br>";

                
    if($serverEntry["virtualserver_status"]=='online')
                {
                    if(
    $serverEntry["virtualserver_maxclients"]==$test2)
                    {
                        echo 
    "Name: <b><font color='green'>".$serverEntry["virtualserver_name"]."</b> | Slots: <b>".$serverEntry["virtualserver_maxclients"]."</b></font><br>";
                        echo 
    "<br>";
                        echo 
    "Slots: $test2";
                        echo 
    "<hr>";
                    }
                    else
                    {
                        echo 
    "Name: <b><font color='red'>".$serverEntry["virtualserver_name"]."</b> | Slots: <b>".$serverEntry["virtualserver_maxclients"]."</b></font><br>";
                        echo 
    "<br>";
                        echo 
    "Slots: $test2";
                        echo 
    "<hr>";
                    }
                }
                else
                {
                    echo 
    "Name: <b><font color='green'>".$serverEntry["virtualserver_name"]."</b></font> | <font color='red'>Server ist offline!</b></font><br>";
                    echo 
    "<br>";
                    echo 
    "Slots: $test2";
                    echo 
    "<hr>";
                }
            }
                
        }
    }
    $telnet->Disconnect();
    ?>

  2. #2
    Join Date
    April 2011
    Location
    Germany
    Posts
    1,266
    Out there are some good php Frameworks, why don't you use one of them? I think the problem might be in your interpretation of the servers reply.

  3. #3
    Join Date
    January 2014
    Location
    Longuich
    Posts
    10
    Hi Barungar,

    the Problem is not the Framework. On other instanzes of my Server it works perfect.

  4. #4
    Join Date
    February 2012
    Location
    Germany
    Posts
    577
    Basically, you are saying: "Look, here I have some php script. Why does it not do what I want?" while you are not providing any output of the script itself. The output of the print_r command alone, for example, would tell everything about why it does not do what you want.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 31
    Last Post: January 19th, 2010, 09:25 PM
  2. [Solved] Teamspeak Website Online/Offline Status
    By paulchain in forum Server Support
    Replies: 1
    Last Post: January 16th, 2010, 02:13 PM

Posting Permissions

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