php-errors

Reliably read value of PHP display_errors

In my PHP error handler I want to do something like: if (ini_get('display_errors') IS ON)) { // show debug info } else { // show just "oops!" } I've look through the docs and stuff, but I can't really find out what the possible values for display_errors are (such as "on", 0, "Yes") and what it does for what value. What should I put ...

Why file upload error codes in php miss number '5'?

I am writing a custom error handling/reporting function for php file upload and I noticed that the error codes returned is one of numbers 0 to 8 except 5. Is this a typo in the source I am using or is it really this way? And if it is so, I am curious why they have skipped number '5'. Thanks. Edit In response to Pekka here are the erro...

PHP config quark with if statements.

Ok this is weird on my development server if I am running a test on a script and shorthand a if statement like so: if($_GET['cat']){ ... Instead of a more pragmatic way like so: if(isset($_GET['cat'])){ ... I will get errors stating that Notice: Undefined variable: pwdmsg in C:\wamp\www\myfile\decrypt-text.php on line 16 ...

PHP error_log errors to MySQL

Hi, In a previous ticket i asked about logging PHP errors in MySQL which gives me: function myErrorHandler($errno, $errstr, $errfile, $errline) { // mysql connect etc here... $sql = "INSERT INTO `error_log` SET `number` = ".mysql_real_escape_string($errno).", `string` = ".mysql_real_escape_string($e...

Display custom error page on all PHP errors and email them to administrator

Afternoon, I've been looking around for a while without success to see if there's a method to display a custom error page, whenever any PHP error arises, hiding the error from users - currently achieved by error_reporting(0), then emailing the specific error to my email address. Initial logic (I know it's not right, it's just to help y...