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;

Anyone have any clues why when I set_error_handler to the above function
errors are being triggered for every page?


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to