PHP Port Prober

This is just a simple little script, but it has proven it's usefulness over and over to me. I thought you might want to find this useful as well!

Code:
<?php
$IPAddress = "127.0.0.1";
$Port = "80";

if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) 
{
****echo "<font color=\"green\">Online</font>";
****fclose($fp);
}
else
{
****echo "<font color=\"red\">Offline</font>";
}
?>
What does this do? It checks if the script can open a connection to the specified IP on the specified port and if it can, it will say Online, and if not.. Take a guess.

It will be able to make a connection if the port is open (thus it's useful as a port prober) and if there is an application to accept the connection (webserver, FTP server, SSH server, peer-to-peer client/server, etc).

Soooooooo. I guess that's it. Oh, configuring it. It's pretty easy, just change 127.0.0.1 to whatever IP or domainname or whatever you want, and 80 to the port you want it to connect to.
For webservers, the default port is 80. FTP is 21. Torrent is 6881-688x I think.
Yeah. Good luck.

Disclaimer: This application might or might not be useful to you. If it is abused somehow (I can't think of any way, but if), don't sue me. Really, please don't. It'll cost me a lot of money, and I love my money.