SaveASmile.co.ukEach day, thousands of families throughout Britain deal with the consequences of bullying, and can find little in their lives to smile about. But, with a little help from YOU, we can make a difference.
New CCKW LayoutThe new layout is here, ore enhancements will be coming in the near future.
With PHP 5.3 and the introduction of deprecation web apps are moments away from seeing those unsighly errors at the top of the page. (unless you decided to turn error reporting off altogether)
PHP has a the function set_error_handler, This will allow you to decide how you wish to handle your errors
- function myErrorHandler($errno, $errstr, $errfile, $errline) {
- switch ($errno) {
- case E_NOTICE:
- case E_USER_NOTICE:
- $errors = "Notice";
- break;
- case E_WARNING:
- case E_USER_WARNING:
- $errors = "Warning";
- break;
- case E_ERROR:
- case E_USER_ERROR:
- $errors = "Fatal Error";
- break;
- case E_DEPRECATED:
- case E_USER_DEPRECATED:
- $errors = "Deprecated";
- break;
- default:
- $errors = "Unknown";
- break;
- }
-
- //here is where you decide what to do with the error, you could save it to file. Put it in a database or display a custom page.
- //You may also want to check the type of error and do different things depending on the situation
-
- printf ("<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br /><br />\n", $errors, $errstr, $errfile, $errline);
- }else{
- }
-
- return true;
- }
-