First, this is not an error, it is warning. Therefore, if the server cannot be changed, each variable should be defined before use.
Method 1: Modify server configurations
Modify the php. ini configuration file, error_reporting = e_all &~ E_notice
Method 2: Initialize the variables and write them in a standardized manner (complicated because there are a large number of variables ). However, we have not found a proper definition method.
Method 3: Add error_reporting (0) to the header of each file. If not, open PHP. ini, find display_errors, and set display_errors to off. No errors will be prompted in the future.
Method 4: Perform judgment: isset ($ _ Get ["page"]) If-else judgment
Or you can add ''@'' to indicate that this line is not aborted if there is an error or a warning.
For example: @ $ page = $ _ Get ["page"]
Method 5: The file1.php file pays a value for the $ XX variable and transmits it to file2.php using post,
If file2.php does not have the definition of $ XX and $ YY = $ XX is used directly, the system reports the error "undifined variaable $ XX ", if the file2.php file is defined with $ xx = "";, the $ XX value of file1.php cannot be passed!
In file2.php
If (! Isset ($ XX) $ xx = "";