11.07.2015 Views

AJAX and PHP

AJAX and PHP

AJAX and PHP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3Without the customized error h<strong>and</strong>ler, the error message you will get would be:Figure 3.5: Bad Looking Error MessageThe error message will look like Figure 3.5 if the display_errors option in php.ini isOn. By default, that option is Off <strong>and</strong> the errors are logged just in the Apache error log,but while writing code it may help to make them be displayed as well. If the code wasproduction code, both error messages would have been inappropriate. You should nevershow such debugging information to your end users.So what happens in error_h<strong>and</strong>ler.php? First, the file uses the set_error_h<strong>and</strong>ler function toestablish a new error-h<strong>and</strong>ling function:77

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!