Codeschnipsel - TS Onlinecheck per GET Form by Micha
Code:<?php if($_REQUEST['Send']) { function check_ts($ip, $tcp, $udp, $timeout=1) { $fp = @fsockopen($ip, $tcp, $errno, $errstr, $timeout); if (!$fp) { $stat = false; } else { if (fgets($fp) == "[TS]rn") { fputs($fp, "SEL $udprn"); if (fgets($fp) == "OKrn") { $stat = true; } else { $stat = false; } } else { $stat = false; } if (is_resource($fp)) @fclose($fp); return $stat; } } $ts_ip = $_REQUEST['ip']; $telnet = $_REQUEST['tcp']; $ts_port = $_REQUEST['udp']; if (check_ts("$ts_ip", $telnet, $ts_port)) { echo "<div align=\"left\"><strong><FONT COLOR=#00cc00><B>Teamspeak is online</B></FONT></strong></div>"; } else { echo "<div align=\"left\"><strong><FONT COLOR=#FF0000><B>Teamspeak is down</B></FONT></strong></div>"; } } else { echo "Â "; } ?>