TeamSpeak Status Checker[PHP]

rofl cake

Well-Known Member
May 25, 2015
204
451
108
Created by Th3f:
A simple PHP-Script that checks, whether a TeamSpeak-Server is online or not. Just fill in the IP (not hostname) of the TS-Server you want to check in the script(s).
SOURCE:
Code:
https://github.com/Th3f/TeamSpeak-Status-Checker
Plaintext response.
tsstatustext.php
PHP:
<?PHP
$ts_ip = "Add IP of TS-Server here"; // Server IP
$ts_port = "10011"; // Port
$output = @fsockopen("$ts_ip", $ts_port, $errno, $errstr, 2);
if (!$output) {
echo "Offline";
die();
}
socket_set_timeout($output, 000002);
echo "Online";
@fclose($output);
?>
With an image response.
tsstatusimage.php
PHP:
<?php
header('Content-Type: image/png');    // Content-Type im HTTP-Response-Header setzen
if($socket = @fsockopen('Add IP of TS-Server here', 10011, $errno, $errstr, 2)) { // IF: Teamspeak-Server erreichbar
    $image = 'online.png';
}
else {    //ELSE: Teamspeak-Server nicht erreichbar
    $image = 'offline.png';
}
@stream_set_timeout($socket, 4); //Timeout für Netzwerkverbindung festlegen
readfile($image);    // Bild einlesen und in Outputpuffer schreiben
?>
 
Last edited:

Norvik

Retired Staff
Contributor
Jul 18, 2015
635
588
157
It worked perfectly but i changed the code a littlebit :)

db9921f794.png
PHP:
<a href="ts3server://Add IP of TS-Server here">
<?php
if($socket = @fsockopen('Add IP of TS-Server here', 10011, $errno, $errstr, 2)) {
  echo '<img src="ts-online.png"/>';
}
else {
  echo '<img src="ts-offline.png"/>';
}
@stream_set_timeout($socket, 4);
?>
</a>
 

9dc

Member
Sep 21, 2015
47
18
43
Created by Th3f:

SOURCE:
Code:
https://github.com/Th3f/TeamSpeak-Status-Checker
Plaintext response.
tsstatustext.php
PHP:
<?PHP
$ts_ip = "Add IP of TS-Server here"; // Server IP
$ts_port = "10011"; // Port
$output = @fsockopen("$ts_ip", $ts_port, $errno, $errstr, 2);
if (!$output) {
echo "Offline";
die();
}
socket_set_timeout($output, 000002);
echo "Online";
@fclose($output);
?>
With an image response.
tsstatusimage.php
PHP:
<?php
header('Content-Type: image/png');    // Content-Type im HTTP-Response-Header setzen
if($socket = @fsockopen('Add IP of TS-Server here', 10011, $errno, $errstr, 2)) { // IF: Teamspeak-Server erreichbar
    $image = 'online.png';
}
else {    //ELSE: Teamspeak-Server nicht erreichbar
    $image = 'offline.png';
}
@stream_set_timeout($socket, 4); //Timeout für Netzwerkverbindung festlegen
readfile($image);    // Bild einlesen und in Outputpuffer schreiben
?>

pls share the picture (online/offline) with us :D
 

Yanolol

Member
Sep 20, 2015
6
4
38
I'm make two bottons.
 

Attachments

  • offline.png
    offline.png
    19.6 KB · Views: 270
  • online.png
    online.png
    19.6 KB · Views: 261

Norvik

Retired Staff
Contributor
Jul 18, 2015
635
588
157
Create a folder on your webspace and create a file which is called tsstatus.php or whatever. Copy one of the php codes from the top into this file, customize the ip, port and image path. Now access the php file and you'll see the image. If you still need help feel free to join our teamspeak server and I'll explain it to you.
 
Last edited:

Shield

Member
Dec 8, 2015
125
14
53
Create a folder on your webspace and create a file which is called tsstatus.php or whatever. Copy one of the php codes from the top into this file, customize the ip, port and image path. Now access the php file and you'll see the image.
Thanks Dude :D ;):p:)
 

rafał Godwin

Member
Dec 17, 2015
2
0
33
Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /virtual/rafalohaki.cba.pl/ts.rafalohaki.cba.pl/index.php on line 7
 

kalle

high minded
Contributor
Oct 28, 2015
411
253
178
<?PHP $ts_ip = "Add IP of TS-Server here"; // Server IP $ts_port = "10011"; // Port $output = @fsockopen("$ts_ip", $ts_port, $errno, $errstr, 2); if (!$output) { echo "Offline"; die(); } socket_set_timeout($output, 000002); echo "Online"; @fclose($output); ?>
 

ULDIN

Well-Known Member
Mar 14, 2016
95
33
108
<?PHP $ts_ip = "Add IP of TS-Server here"; // Server IP $ts_port = "10011"; // Port $output = @fsockopen("$ts_ip", $ts_port, $errno, $errstr, 2); if (!$output) { echo "Offline"; die(); } socket_set_timeout($output, 000002); echo "Online"; @fclose($output); ?>
PHP:
<a href="ts3server://ts3destek.org">
<?php
if($socket = @fsockopen('193.70.21.81', 10011, $errno, $errstr, 2)) {
  echo '<img src="online.png"/>';
}
else {
  echo '<img src="offline.png"/>';
}
@stream_set_timeout($socket, 4);
?>
</a>
where can I add @kalle

---- Automatically Merged Double Post ----

query port not server port
 
Last edited:
Top