Results 1 to 6 of 6
-
17-08-2005, 04:18 #1
-= TeamSpeak User =-
- Join Date
- Aug 2005
- Location
- UK
- Posts
- 5
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
-
17-08-2005, 11:04 #2
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", 51234, 8767)) { //Change IP, Query-Port, TS-Port
echo "<font color=#00DD00><b>ONLINE</b></font>";
} else {
echo"<font color=#DD0000><b>OFFLINE</b></font>";
}
?>
-
17-08-2005, 16:16 #3
-= TeamSpeak User =-
- Join Date
- Aug 2005
- Location
- UK
- Posts
- 5
how do i use php with an html page?
-
17-08-2005, 17:00 #4
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.
-
17-08-2005, 17:03 #5
-= TeamSpeak Fanatic =-
- 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.
-
17-08-2005, 17:07 #6
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
-
Team Speak Tool
By -t-Lumis in forum [TeamSpeak 2] Addons & ScriptsReplies: 32Last Post: 09-09-2006, 14:41 -
No text on TS status!
By Toltec in forum [TeamSpeak 2] Addons & ScriptsReplies: 5Last Post: 27-03-2005, 19:39 -
Server Status HTML Script
By nmysytes in forum [TeamSpeak 2] Addons & ScriptsReplies: 3Last Post: 04-06-2004, 18:00 -
Server IMAGE & WEBPOST Status javascript
By Choopscraidy in forum [TeamSpeak 2] General QuestionsReplies: 2Last Post: 19-04-2004, 04:26


Reply With Quote

