TeamSpeak Status Checker[PHP]

rofl cake

Well-Known Member
Joined
May 25, 2015
Messages
204
Reaction score
451
Points
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
Joined
Jul 18, 2015
Messages
635
Reaction score
588
Points
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
Joined
Sep 21, 2015
Messages
47
Reaction score
18
Points
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
Joined
Sep 20, 2015
Messages
6
Reaction score
4
Points
38
I'm make two bottons.
 

Attachments

  • offline.png
    offline.png
    19.6 KB · Views: 271
  • online.png
    online.png
    19.6 KB · Views: 262

Norvik

Retired Staff
Contributor
Joined
Jul 18, 2015
Messages
635
Reaction score
588
Points
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
Joined
Dec 8, 2015
Messages
125
Reaction score
14
Points
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
Joined
Dec 17, 2015
Messages
2
Reaction score
0
Points
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
 

ULDIN

Well-Known Member
Joined
Mar 14, 2016
Messages
95
Reaction score
33
Points
108
server port add where ?
 

kalle

high minded
Contributor
Joined
Oct 28, 2015
Messages
411
Reaction score
253
Points
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
Joined
Mar 14, 2016
Messages
95
Reaction score
33
Points
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:

kalle

high minded
Contributor
Joined
Oct 28, 2015
Messages
411
Reaction score
253
Points
178
Just add your server port, ignore this query port.
 
Top