1. because the variable is undefined, we only need to find the relevant location and add the following code: function_get ($ str) {$ val! Emptyempty (... 1, because the variable is undefined, we only need to find the relevant location and add the following code:
Function _ get ($ str) {$ val =! Emptyempty ($ _ GET [$ str])? $ _ GET [$ str]: null; return $ val ;}
Or we can:
Isset ($ _ GET ['Your variable'])? $ _ GET ['Your variable']: '';
In the above example, we only use get and post, as long as we change the get to post. There is also a global definition method of the program:
If (! $ Cfg ['debug']) {error_reporting (0); ob_start ('OB _ gzhandler');} else {error_reporting (E_ALL ^ E_NOTICE );}
In this way, we only need to set the debug variable to 0 or 1 to switch the error message.
Methods provided by other web pages:
Method 1: modify the server configuration and modify the php. ini configuration file. error_reporting = E_ALL &~ E_NOTICE
Method 2: Add @ Before the notice code appears. @ indicates that the line has an error or the warning is not output. @ $ username = $ _ post ['username'];
Note: If you are using a global definition or modifying php. the ini configuration file does not display all the error prompts, which is quite troublesome for development and testing. we recommend that you use the program method to disable the error prompt on the server.