About register_globals settings. For various reasons, PHP settings must be enabled based on the register_globals parameter, but it also becomes an important security risk. please refer to the following code: remote users can be simplified for a variety of reasons. The PHP setting depends on the register_globals parameter, but it also becomes an important security risk. please refer to the following code: Remote users can simply pass authenticated as form variables. even if the authenticate_user () function returns false, $ authenticated is set to true. This is a simple example. you may say that my program won't be written like this. In fact, in a slightly more complex application, this mechanism will become a major vulnerability. Therefore, for the new version of PHP, we recommend that you do not use this variable to control the application, although we do not intend to delete it in the near future. To help you create an application with register_globals set to off, some variables are added to replace the old ones. The following are seven new arrays: $ _ GET-contains the form variable sent through GET $ _ POST-contains the form variable sent through POST $ _ COOKIE-contains the HTTP cookie variable $ _ SERVER-contains the SERVER side variable (for example: REMOTE_ADDR) $ _ ENV-contains the environment variable $ _ REQUEST-GET variable, the combination of the POST variable and the Cookie variable, and variables that cannot be trusted by users. $ _ SESSION-contains the HTTP variables registered through the SESSION module. these variables are automatically set as global variables in any range and can be called anywhere without the need for a global keyword. For example, function example1 () {print $ _ GET ["name"]; // You do not need to write it as global $ _ GET ;} another tips is to add a record in the $ _ SESSION array to automatically register as a SESSION variable, just as you have called the session_register () function.
The region setting depends on the register_globals parameter, but it also becomes an important security risk. please refer to the following code: remote users can be simplified...