"" PHP Access form variables [PHP Note 001]
There are three ways that PHP provides access to form variables:
1, $name;
2. $_post[' name '],$_get[' name '],$_request[' name '],
3. $HTTP _post_vars[' name ']
$name; Short style
$_post[' name '],$_get[' name '],$_request[' name ',//Medium style
$HTTP _post_vars[' name ']//verbose style
In practical applications, we generally try the medium style. Even using: $_post[' name ' to refer to the form variables, but for easier use, we also create short-style variables, however, in the code, we use this style instead of the automatically selected style to refer to the variable, because the automatic selection of style may bring security problems.
Other than that:
1, Short mark: ($name) is very convenient to use, but PHP because of security reasons, the default does not support this tag. You need to turn on the register_globals configuration option set to ON.
2. Medium mark: ($_post[' name ') allows us to recommend the tag.
3, verbose style: ($HTTP _post_vars[' name ') is the most detailed, but because the performance and ease of use has been deprecated, and it is likely to be deleted later, so if the project is not intended to use on the old version of the server, it is not recommended to try this style;