Home >Backend Development >PHP Tutorial >Notice: undefined index.. Error prompt solution_PHP tutorial
This sentence is about some problems that will be encountered in PHP development. Looking at this prompt, we all know that the variable is undefined, so let’s solve the Notice: undefined index method.
First, because the variable is undefined, we only need to Find relevant location plus
The code is as follows
|
Copy code
|
||||||||
function _get($str){
or
} Modify the php.ini configuration file, error_reporting = E_ALL & ~E_NOTICEMethod 2: Add @ before the notice code appears. @ indicates that there is an error in this line or a warning not to output, @$username=$_post['username'];
Note: If you are using global definitions or modifying the php.ini configuration file so that all error prompts will not appear, this will be quite troublesome for development and testing. The best way to use the program is to turn off the error prompts. Set up on the server.
http://www.bkjia.com/PHPjc/632213.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632213.htmlTechArticleThis sentence is about some problems that will be encountered in PHP development. Looking at this prompt, we all know that the variable is undefined. Then let’s solve the Notice: undefined index method. 1. This is because the variable is undefined...
|