We often receive the form POST Data times undefined index error, as follows: $act =$_post[' action '];
Always prompt with the above code
notice:undefined index:act in D:\test\post.php on line 20
In addition, there are sometimes
Notice:undefined Variable:submit ... And so on some of these tips
These are the PHP prompts instead of the error, PHP itself does not need to declare the variable in advance can be used directly, but not declared variables will be prompted. Generally as a formal website will turn off the prompts, and even the error message is turned off.
Workaround:
1 precede the variable with a @, as if (@$_get[' action ']== ' save ') {...
2) Modify the error configuration in the php.ini to display the wrong way: error_reporting = E_all change to
error_reporting = e_all& ~e_notice
After the modification, restart the Apche server before it can take effect.
------------------------------------------------------------------------------
[Php-core-error]
error_reporting = E_all & ~e_notice
; The error reporting level is the superposition of bit fields and is recommended for use with E_all e_strict
; 1 E_error Fatal Run-time Error
; 2 e_warning Runtime Warning (non-fatal error)
; 4 E_parse Compile-time parse error
; 8 E_notice Runtime Reminders (often bugs or intentional)
; E_core_error fatal error during initialization during PHP startup
; E_core_warning warning during initialization of PHP (non-fatal error)
; E_compile_error compile-time fatal error
; 128 E_compile_warning Compile-time warning (non-fatal error)
; 256 e_user_error user-defined fatal error
; E_user_warning user-defined warning (non-fatal error)
; 1024 E_user_notice user-defined reminders (often bugs, possibly intentional)
; 2048 E_strict Coding Standardization Warning (recommended how to modify to forward compatible)
; 4096 E_recoverable_error is close to fatal run-time error and is treated as if not captured E_error
; 6143 e_all All errors except E_strict (8191 in PHP6, including all)
This article links http://www.cxybl.com/html/wlbc/Php/20120720/31927.html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.