= "4.2.0"){ extract($_POST); extract($_SERVER); extract($_ENV); } # The print_details function is what prints the 404 error to # the visitor. function print_details(){ # Request access to the global variables we need global $fontface, $fontsize, $docroot, $REQUEST_URI, $reportlevel; global $bgcolor, $textcolor; # Print the 404 error in web format echo << 404 Not Found

Page Not Found (404 Error)

We're sorry. The page you requested:

$docroot$REQUEST_URI

doesn't seem to exist on this server.

EOT; # If an email report is being generated, let the visitor know: if ($reportlevel != 0){ echo "

The details of this error have been logged and flagged for the website owner.

"; } return; } # 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, $HTTP_USER_AGENT, $emailaddress, $REMOTE_HOST, $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 Example Page\n\nA 404 Missing file error Example Page 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"; $message .= "The user agent was:\n$HTTP_USER_AGENT\n\n"; $message .= "The remote host was:\n$REMOTE_HOST\n\n"; $message .= "v. 2005-10-11.1153am\n\n"; # Send the mail message. This assumes mail() will work on your system! $headers = "From: $emailaddress\nDate: $errortime -0700\n"; $subject = "404 Error: $docroot$REQUEST_URI"; mail($emailaddress, $subject, $message, $headers); return; } # Done with function declarations. Main function begins here. header("404 Not Found"); # Send a 404 error to the user's browser print_details(); # See whether or not we should send an email report. If so, do it. if ($reportlevel != 0) if ($reportlevel == 1) { if (eregi($domain,$HTTP_REFERER)) send_email(); } else send_email(); # Close up the HTML tags echo "

Please try one of the following links:

Brainstorms and Raves Home - Sitemap - Search

"; ?>