• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Offline / Online Status script

#1
Hello,

Im looking to add the following code to my template to display an application on an IP using a certain port if its Online or Offline.

PHP:
<?php
$ts_ip = "110.232.112.159"; // Change to your server's IP external or domain name
$ts_port = "7777"; // Make sure this port is open on the router or firewall

$output = @fsockopen("$ts_ip", $ts_port, $errno, $errstr, 2);
socket_set_timeout($output, 000002);

if (!$output) {
    echo "<FONT COLOR=#DD0000><B>Offline</B></FONT>";
} else {
    echo "<FONT COLOR=#00DD00><B>Online</B></FONT>";
}
@fclose($output);
?>
Im new to the whole Xen forum, and need alittle help.

Thanks