"; $r .= "
"; $r .= "
"; $r .= "uri: ".$_SERVER['HTTP_HOST']."".$_SERVER['REQUEST_URI']."
\n"; $r .= "referer: ".$_SERVER['HTTP_REFERER']."
\n"; $r .= "script: ".$_SERVER['SCRIPT_FILENAME']."
\n"; $r .= "
"; $r .= "
"; $r .= "
"; $r .= "
"; $r .= "
REQUEST
"; $r .= "
".print_r($_REQUEST, true)."
"; $r .= "
"; $r .= "
"; $r .= "
"; $r .= "
PHP Exception: ".get_class($ex)."
"; $r .= "
".nl2br($ex->getMessage())."
"; $r .= "
"; $r .= "
"; $r .= "
\n"; $r .= "
Backtrace
\n"; $r .= "
\n";

    foreach ($ex->getTrace() as $step) {
        $r .= $step['file'].": (".$step['line'].")\n";
    }

    $r .= "
\n"; $r .= "
\n"; $r .= "
\n"; foreach ($ex->getTrace() as $step) { $r .= printErrFile($step['file'], $step['line']); } $r .= "
"; $r .= "
\$_REQUEST
"; $r .= "
".print_r($_REQUEST, true)."
"; $r .= "
"; $r .= "
"; $r .= "
"; $r .= "
\$_SERVER
"; $r .= "
".print_r($_SERVER, true)."
"; $r .= "
"; $r .= "
"; $r .= "
"; //Surrounding white background div if (defined('ERROR_STD')) { echo $r; } if (defined('ERROR_EMAIL')) { $boundary = strtoupper(md5(uniqid(time()))); $header = "From: noreply@nambu.ch (PHP Exceptionhandler)"; $header .= "\nX-Mailer: PHP ". phpversion(); $header .= "\nMIME-Version: 1.0"; $header .= "\nContent-Type: multipart/mixed; boundary=$boundary"; $header1 = "This is a multi-part message in MIME format -- Dies ist eine mehrteilige Nachricht im MIME-Format"; $header1 .= "\n\n--$boundary"; $header1 .= "\nContent-Type: text/html"; $header1 .= "\nContent-Transfer-Encoding: 8bit"; $header1 .= "\n\n$r"; /* Hier faengt der Datei-Anhang an */ $header1 .= "\n--$boundary"; $header1 .= "\nContent-Type: application/octetstream; name=\"session.txt\""; $header1 .= "\nContent-Transfer-Encoding: base64"; $header1 .= "\nContent-Disposition: attachment; filename=\"session.txt\""; $header1 .= "\n\n"; $header1 .= chunk_split(base64_encode("\$_SESSION: ".print_r($_SESSION, true))); /* Gibt das Ende der eMail aus */ $mail_header .= "\n--$boundary--"; $err = mail(ERROR_EMAIL, "Catched PHP Exception", $header1, $header); include "errorpage.html"; } //error happened. stop execution! exit(1); } ?>