Code:
<?php
//0skillz testin testin 123 :P
//Location of the live or dead server images make your own whether it be ermm DOD or CSS blah blah
//Please change to your server specifications :P
$live = "http://213.208.119.245/cstrike/images/tv-live.gif";
$dead = "http://213.208.119.245/cstrike/images/tv-dead.gif";
//The status checking script purely fer feckin fun :P
//meddle at your own risk! joo have been warned :P
//check for port number, default is 27075 change it to your TV of course :P
$link = $_GET['link'].":";
$s_link = str_replace("::", ":", $link);
list($addr,$port)= explode (':',"$s_link");
// chamge your server port below
if (empty($port)){
$port = 27075;
}
//Test the server connection
$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
if (!$churl){
//echo $errstr;
header("Location: $dead");
}
else {
header("Location: $live");
}
function server($addr){
if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}
return $addr;
}
?>
save the above as status.php
Code:
<html>
<head>
<title>TV Source Server Status</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="77%"><font face="Arial, Helvetica, sans-serif" size="2">SourceTV @ 213.208.119.245:27075</font></td>
<td width="23%">[img]status.php?link=http://213.208.119.245/cstrike/images[/img]</td>
</tr>
</table>
</body>
</html>
And save this as ermmm wotever HTML server.html you can call it what you want as this will be the page we will link to check the status of your server
Obviously you need to change the website and game server IP to suit your own needs.
Oh and before you ask NO! i havnt tried it but in theory it should work as i based it on the same idea as ICQ online web status.
Just an idea but i guess all your looking to do is check the port is open as if am not mistaken is usually differnt from the actual game slot port so all you wanna do is get it to check if that port is open which means the tv source is up and if closed then its obviously down.
__________________