chinmay.sahoo
New member
If you want to set the error level for a particular script, add a statement with the following format to the beginning of the script:
The OPTIONS in the statement are the built-in constants discussed in the preceding section. For example, you can have all errors, warnings, and notices displayed in the script by adding the following statement
Suppose the setting in php.ini is set to E_ALL. You may be satisfied with that level while developing your scripts, but then want to stop displaying notices when users start running your scripts. To override the php.ini setting, you can add the following statement to the scripts after they are finetuned and ready to go:
You can set error reporting so that no messages are displayed by using the following statement .
Sometimes you want to turn error and warning messages off when your scripts are complete and being used by the world. You may not want users to see the error messages that PHP sends because the information in the PHP
messages can represent a security issue, but you may want to see any error messages from PHP yourself. You can turn error reporting off by using a setting of zero, but log the error messages to a file at the same time. Users don’t see the messages, but you can look at them. Sending messages to a log is described in the next section.
error_reporting(OPTIONS);
The OPTIONS in the statement are the built-in constants discussed in the preceding section. For example, you can have all errors, warnings, and notices displayed in the script by adding the following statement
error_reporting(E_ALL);
Suppose the setting in php.ini is set to E_ALL. You may be satisfied with that level while developing your scripts, but then want to stop displaying notices when users start running your scripts. To override the php.ini setting, you can add the following statement to the scripts after they are finetuned and ready to go:
error_reporting(E_ALL & ~E_NOTICE);
You can set error reporting so that no messages are displayed by using the following statement .
error_reporting(0);
Sometimes you want to turn error and warning messages off when your scripts are complete and being used by the world. You may not want users to see the error messages that PHP sends because the information in the PHP
messages can represent a security issue, but you may want to see any error messages from PHP yourself. You can turn error reporting off by using a setting of zero, but log the error messages to a file at the same time. Users don’t see the messages, but you can look at them. Sending messages to a log is described in the next section.