/* Utorrent */
$ip = "ip";
$port = "port";
if (! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo '<font color="red"><b>Offline</b></font>';
else{
echo '<font color="green"><b>Online</b></font>';
fclose($sock);
}
?>
I'm using it to detect if certain things on my pc are online, VNC FTP etc etc, and I'm trying to think of a way to detect if my PC is actually ON. I thought of cheating and using an existing port (say the VNC port) but it's possible that VNC could crash and be offline while the computer is still on, is there an easier way to do this or should I continue using the VNC port?

New Topic/Question



MultiQuote






|