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

Offline / Online Status script

Discussion in 'XenForo Questions and Support' started by Adam Wakefield, Jul 26, 2011.

  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$errstr2);
    socket_set_timeout($output000002);

    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
     

Share This Page