The php $ _ GET variable $ _ GET is used to collect the values in the form from method = "get.
$ _ GET variable
The $ _ GET variable is an array with the variable name and value sent by the http get method.
The $ _ GET variable is used to collect the values in the form from method = "get. The information sent from a form with the GET method is visible to anyone (displayed in the address bar of the browser), and the amount of information sent is limited (up to 100 characters ).
Example
When you click the submit button, the sent URL is similar to the following:
http://www.w3school.com.cn/welcome.php?name=Peter&age=37
The "welcome. php" file can now GET form data using the $ _ GET variable (note that the name of the form field will automatically become the ID key in the $ _ GET array ):
Welcome
.
You are
years old!
Why use $ _ GET?
Note: When $ _ GET is used, 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 variables are displayed in the URL, you can add the page to favorites. In some cases, this is useful.
Note: The http get method is not suitable for large variable values. The value cannot exceed 100 characters.
$ _ REQUEST variable
The $ _ REQUEST variable in PHP contains $ _ GET, $ _ POST, and $ _ COOKIE content.
The $ _ REQUEST variable of PHP can be used to obtain the results of form data sent through the GET and POST methods.
Example
Welcome
.
You are
years old!