Error reporting is one of the tools an advanced or intermediate PHP developer should be look into.
Once your application is developed for open market, one of the basic thing you should do is to turn off all errors or turn on some runtime errors . If not done, hackers can use this loopholes to penetrate your applications.
Look in below the codes for php error reporting.
<?php
// Turn off error reporting
error_reporting(0);
// Report runtime errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Report all errors
error_reporting(E_ALL);
// Same as error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);
// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
?>
// Turn off error reporting
error_reporting(0);
// Report runtime errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Report all errors
error_reporting(E_ALL);
// Same as error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);
// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
?>
for more reference on error reporting in php. refer to php.net
No comments:
Post a Comment