The $_get variable is used to collect values from the form method= "GET".
$_get variable
The $_get variable is an array of variable names and values that are sent by the HTTP GET method.
The $_get variable is used to collect values from the form method= "GET". Information sent from a form with a GET method is visible to anyone (displayed in the browser's address bar) and has a limit (up to 100 characters) to the amount of messages sent.
Example
When the user clicks the Submit button, the URL is sent like this:
http://www.w3school.com.cn/welcome.php?name=Peter&age=37
The "welcome.php" file can now get form data through the $_get variable (note that the name of the form field automatically becomes the ID key in the $_get array):
Welcome
.
You are
years old!
Why use $_get?
Note: When using the $_get variable, all variable names and values are displayed in the URL. Therefore, this method should not be used when sending passwords or other sensitive information. However, because the variable is displayed in the URL, you can bookmark the page in the Favorites folder. In some cases, this is useful.
Note: The HTTP GET method is not suitable for large variable values, and the value cannot exceed 100 characters.
$_request variable
PHP's $_request variable contains the contents of $_get, $_post, and $_cookie.
PHP's $_request variable can be used to obtain the results of form data sent through the GET and POST methods.
Example
Welcome
.
You are
years old!