$ Act $ _ POST [& amp; 39; act & amp; 39;]; the following code always prompts: Notice: Undefinedindex: actinF: windsflybookpostphponline18.
$ Act = $ _ POST ['AC']; the following code always prompts: Notice: Undefined index: act in F: windsflybookpost. php on line 18.
In addition, sometimes there are some such prompts as: Notice: Undefined variable: Submit...
Cause:Caused by undefined variables
Solution:
1) error_reporting settings: locate error_reporting = E_ALL and change it to error_reporting = E_ALL &~ E_NOTICE
2) register_globals settings: find register_globals = Off and change it to register_globals = On.
- Notice: Undefined variable: email in D: PHP5ENOTEADDNOTE. PHP on line 9
- Notice: Undefined variable: subject in D: PHP5ENOTEADDNOTE. PHP on line 9
- Notice: Undefined variable: comment in D: PHP5ENOTEADDNOTE. PHP on line 9
- ........
Php does not need to define variables, but what should I do in this case? In C: WINDOWS, find row 302 in php. ini and change error_reporting = E_ALL to error_reporting = E_ALL &~ E_NOTICE: restart apache2.2.
Solution: modify php. ini
Change error_reporting = E_ALL to error_reporting = E_ALL &~ E_NOTICE
If you do not want to display any errors, modify display_errors = Off.
If you do not have permission to modify php. ini, you can add ini_set ("error_reporting", "E_ALL &~ E_NOTICE ");