Home > Article > Backend Development > php Undefined variable and Undefined index_PHP tutorial
php tutorial undefined variable and undefined index
This problem occurs because the variable is undefined. We only need to add a verification such as
$a =isset($_get['aa'])?$_get['aa']:'Variable is undefined';
In this way, undefined variables will not appear undefined variable and undefined index
Yes, we also provide methods to set error not prompting in php ini or php
Solution:
1) error_reporting settings:
Find error_reporting = e_all
Modify to error_reporting = e_all & ~e_notice
2) register_globals settings:
Find register_globals = off
Modify to register_globals = on