// This function check the ftp status and return true (online) or false (offline)
function is_online($server='localhost',$port=80,$timeout=2) {
$fp = @fsockopen($server, $port, &$errno, &$errstr, $timeout);
if (!$fp)
echo "Offline";
$sendEmail = "* Monitor ";
$emailto = "youraddress@whothefekknows.net";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $sendEmail" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$subject = "OMG IT BORKED!!!1111oneone";
$message = "
Enter your formated email here!
blah blah blah
<
blah blah blah
";
mail($emailto, $subject, $message, $headers);
else
{
fclose($fp);
echo "Online";
}
}
?>.