set_error_handler() Keeps Triggering Errors

From: Date: Sun, 10 Nov 2002 05:34:34 +0000
Subject: set_error_handler() Keeps Triggering Errors
Groups: php.general 
Request: Send a blank email to php-general+get-123654@lists.php.net to get a copy of this message
When I use set_error_handler('error_function') in my scripts, errors are constantly being triggered that I've never seen before. If I comment the handler function out, the errors go away. I have the error reporting set very loosely: error_reporting (E_ERROR | E_USER_ERROR) - so not sure why it keeps triggering an error, because the error I keep getting is: Undefined variable: target This is the same error message no matter what script I run. I don't even use a variable named $target anywhere in any of my scripts, so, this is baffling. And this seems like an E_NOTICE error message, but, I'm only asking for E_ERROR and E_USER_ERROR notices. My error handling function is fairly simple. It just loads the error info in a session var then sends the user to the error page, which reads the error info from the session vars and displays it. function show_error($type, $msg, $file, $line, $context) { // Setup error message in Session var... $_SESSION['error']['type'] = $type; $_SESSION['error']['msg'] = $msg; $_SESSION['error']['file'] = $file; $_SESSION['error']['line'] = $line; header("Location:./error_page.php"); } Anyone have any clues why when I set_error_handler to the above function errors are being triggered for every page? Monty

« previous php.general (#123654) next »