zhaoJian's Tech Notes

Solution for PHP Undefined index and Undefined variable Errors

Technology ~498 words · 2 min read - views

During project development, I kept getting this notice: Notice: Undefined index: act in *:**.php on line * Also, sometimes this appears: Referenced content Notice: Undefined variable: Submit … and similar notices. Reason: Caused by undefined variables Solutions: 1 error_reporting setting: Find

error_reporting = E_ALL

Change to

error_reporting = E_ALL & ~E_NOTICE

2 register_globals setting: Find

register_globals = Off

Change to

register_globals = On
Share:

Comments