# Request access to the global variables we need global $fontface, $fontsize, $docroot, $REQUEST_URI, $reportlevel; global $bgcolor, $textcolor; #Until I rewrite my scripts, this will suffice for bg-compatibility; #if(phpversion() = "4.2.0"){ extract($_POST); extract($_SERVER); extract($_ENV); #} # The send_email function sends the details of the 404 error to the # webmaster. function send_email(){ # Request access to the global variables we need global $REQUEST_URI, $HTTP_REFERER, $emailaddress, $REMOTE_ADDR, $docroot; # Build the $errortime variable to contain the date/time of the error. $errortime = (date("d M Y h:m:s")); # Create the body of the email message $message .= "404 Error Report\n\nA 404 error was encountered by $REMOTE_ADDR"; $message .= " on $errortime.\n\n"; $message .= "The URI which generated the error is: \n$docroot$REQUEST_URI\n\n"; $message .= "The referring page was:\n$HTTP_REFERER\n\n"; # Send the mail message. This assumes mail() will work on your system! $headers = "From: $emailaddress\nDate: $errortime -0600\n"; $subject = "404 Error: $docroot$REQUEST_URI"; mail($emailaddress, $subject, $message, $headers); return; } # Done with function declarations. Main function begins here. ?>
"We have a problem" echo " |