Community Forums Today's Posts     Member List     Archive    
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2005
    Location
    UK
    Posts
    5

    Angry HTML For TS Online/Offline Status

    i need code for my html website just to show wheter the ts server is online or offline nothing else!

    Thanks

  2. #2
    Join Date
    Oct 2004
    Location
    Germany
    Posts
    1,301
    I think there is no way with HTML

    But you can use PHP

    PHP Code:
    <?php
    //Function
    function check_ts($ip$tcp$udp$timeout=1) {
    $fp = @fsockopen($ip$tcp$errno$errstr$timeout);
    if (!
    $fp) {
    $stat false;
    } else {
    if (
    fgets($fp) == "[TS]\r\n") {
    fputs ($fp"SEL $udp\r\n");
    if (
    fgets($fp) == "OK\r\n") {
    $stat true;
    } else {
    $stat false;
    }
    } else {
    $stat false;
    }
    if (
    is_resource($fp))
    @
    fclose($fp);
    return 
    $stat;
    }
    }


    if (
    check_ts("localhost"512348767)) { //Change IP, Query-Port, TS-Port
      
    echo "<font color=#00DD00><b>ONLINE</b></font>";
    } else {
      echo
    "<font color=#DD0000><b>OFFLINE</b></font>";
    }

    ?>

  3. #3
    Join Date
    Aug 2005
    Location
    UK
    Posts
    5
    how do i use php with an html page?

  4. #4
    Join Date
    Oct 2004
    Location
    Germany
    Posts
    1,301
    PHP is an other Language than HTML.
    You only must upload the Script with the ending *.php on your webserver.
    But your webspace must accept PHP.

    The Output of this PHP Script is an HTML Page.

  5. #5
    Join Date
    Jan 2003
    Location
    Germany
    Posts
    4,140
    If your webspace doesn't support PHP you're out of luck. There is a way of including the output of a PHP script running on another server by means of Javascript includes. Basically you have the PHP script generate a Javascript that generates HTML and do a remote include. But that's quite a hassle.

  6. #6
    Join Date
    Oct 2004
    Location
    Germany
    Posts
    1,301
    If your Webspace doesn't support PHP.

    This Project is interesting for you: http://www.tsviewer.de

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Team Speak Tool
    By -t-Lumis in forum [TeamSpeak 2] Addons & Scripts
    Replies: 32
    Last Post: 09-09-2006, 14:41
  2. No text on TS status!
    By Toltec in forum [TeamSpeak 2] Addons & Scripts
    Replies: 5
    Last Post: 27-03-2005, 19:39
  3. Server Status HTML Script
    By nmysytes in forum [TeamSpeak 2] Addons & Scripts
    Replies: 3
    Last Post: 04-06-2004, 18:00
  4. Server IMAGE & WEBPOST Status javascript
    By Choopscraidy in forum [TeamSpeak 2] General Questions
    Replies: 2
    Last Post: 19-04-2004, 04:26

Posting Permissions

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