Considerations for using PHP4.2.0 and later versions

Source: Internet
Author: User

From PHP 4.2.0 onwards, the default value of the PHP Command register_globals is off (in the php. ini configuration file). This is a major change in PHP. What is register_globals used? PHP is used to control whether the EGPCS (Environment, GET, POST, Cookie, Server) variables are registered as global variables. For example, for a http://www.xx.php? Var = 2 here var. When it is on, you only need to use $ var, but when it is off, you must use $ _ GET ["var"] to receive ~ $ _ GET is an array of PHP super global variables. Like this, $ GLOBALS includes a reference to a variable that is valid globally for each current script. The key of the array is the name of the global variable. $ GLOBALS array exists from PHP 3. $ _ SERVER variables are set by the Web SERVER or directly associated with the execution environment of the current script. It is equivalent to the old array $ HTTP_SERVER_VARS, but it is not a variable with $ _ SERVER, because PHP processes them differently, the same below. Although $ HTTP_SERVER_VARST and $ HTTP _ * _ VARS below can still be used, we do not recommend that you use $ HTTP _ * _ VARS. $ _ GET: variables submitted to the script through the http get method. For example, variables generated by the GET method of URLs and forms. Usage: $ _ GET ["xx"]; // the variable that is $ xx; the same as $ _ POST submitted to the script through the http post method. For example, a variable generated by the form POST method. Usage: $ _ POST ["xx"]; $ _ COOKIE variables submitted to the script through HTTP Cookies. For example, when reading the COOKIE value. $ _ FILES variables submitted to the script by uploading the http post file. My other article asp $ id = 22950 & page = 1 target = _ blank> describes the usage of the file upload process in detail, it is not described here. $ _ ENV: variables submitted to the script in the execution environment. $ _ REQUEST the variables submitted to the script through any user input mechanism, including GET, POST, and COOKIE. Therefore, this array is not trustworthy. $ _ SESSION: array of SESSION variables. You do not need to use session_regisger to register a variable. $ _ SESSION ["xx"] contains the preceding process. Do not post this post again. If you have any questions, start a new topic [br]. Thank you for your cooperation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.