When debugging the program, there may be undefined variable error, in general, PHP does not need to define variables, but if the server error, there will be errors, we often receive form post data times undefined index error is as follows : $act =$_post[' action '), or Always prompt notice:undefined index:act in D:\workspace\test.php on line 48. Additionally, sometimes notice is present: Undefined variable: $up ... Wait for some such hints, so the server should be shielded from this error. This behavior occurs because the variable is not defined.
Workaround, find the location of the php.ini:
1) in error_reporting settings: Find error_reporting = E_all modified to error_reporting = E_all & ~e_notice.
2) in Register_globals settings: Find register_globals = OFF; Modified to register_globals = on; Notice:undefined Variable:email in D:\PHP5\ENOTE\ADDNOTE. PHP on line 9.
In addition, we must note that after modifying the php.ini file, be sure to remember to restart Apache. Otherwise, the modification will not work.
If any errors do not want to let the display, directly modify: Display_errors = Off If you do not have php.ini Modify permissions, you can add Ini_set ("error_reporting", "E_all & ~e_notice" in the PHP header ); Can.
PHP undefined variable error how to solve?