Pre-defined variables
1. Scope issues
In PHP, there are two scopes for custom variables: global scope (outside function), local scope (inside function)
But:
The predefined scopes become "hyper global Scopes": The sum of global scopes + local scopes.
2: Data type problem:
In general, hyper-global scopes are arrays!
Review:
3. Predefined scopes typically include:
$_get,$_post,$_server,$_request, $GLOBALS .....
(ii) Illustrative examples
$_get variable
Get, which generally appears in the form form: <form action = "abc.php" >.....<form/>
Called: Form submits data in Get mode
$_get, this predefined array variable refers to the collection (array) of all data submitted in this manner.
Of course, you can also submit data by post.
2. In Web pages, get is submitted in a variety of ways
Form 1:
Form 2:
Form 3:
Form 4:
Where the data obtained is the same regardless of the way it was submitted:
<?php
$v 1 = $_get[' uName ')//single quotes, double quotes are OK, essentially a string.
$v 2 = $_get[' upswd ');
?>
Add:
php02~ pre-defined variables