How can I get this to not store warnings such as 8Undefined index: HTTP_REFERER ?

GJay

02-05-2007, 08:52 PM

undefined index is a E_NOTICE-level error, so setting error-reporting to
error_reporting(E_ALL ^ E_NOTICE);
will prevent it from being reported.

take a look at http://php.net/error-reporting for more details

esthera

02-06-2007, 06:19 AM

instead of error_reporting(0); -- I don't want any errors to show but my error handler picks them up and saves them.
i don't want to save any warnings

how do I do this?

_Aerospace_Eng_

02-06-2007, 06:23 AM

Did you even try what GJay suggested? error_reporting(0) is not what he suggested.

CFMaBiSmAd

02-06-2007, 06:39 AM

For variables that may or may not exist, write code using the isset() function to avoid the generation of the error in the first place, instead of messing around with the error reporting or error handler after the error has already been generated. Your code will actually run faster by doing this as well.

marek_mar

02-06-2007, 11:12 AM

A custom error handler in PHP will get to handle all errors it can - it doesn't use the error_reporting setting to see if it should handle an error or not.