rofl cake
Well-Known Member
- May 25, 2015
- 204
- 451
- 108
Created by Th3f:
Plaintext response.
tsstatustext.php
With an image response.
tsstatusimage.php
SOURCE: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).
Code:
https://github.com/Th3f/TeamSpeak-Status-Checker
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);
?>
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: