PHP $ _ GET gets HTML Form (Form) or url data. I have nothing to do today to tell you that I learned php many years ago to learn how to use get global variables. For more information, see. I. $ _ GET is the method used to get the table. it's nothing to do today. I told you that I learned php many years ago and learned how to use GET global variables, for more information about getting started, see.
1. $ _ GET is used to obtain data in the form of get in the table method.
2. $ _ GET url. php? I = 12 data,
The above is the data we often use get to obtain values,
Instance 1: Get form data
Get. php
Assume that I entered www.hzhuti.com
The code is as follows: |
|
You are . |
The output result is
The code is as follows: |
|
You are www.hzhuti.com |
What is the url style when we click to submit?
The code is as follows: |
|
Get. php? Username = www.hzhuti.com |
This form is the second method we are talking about to obtain data. next we will look at using a for reference.
/A. php? Value = my
A. php
The code is as follows: |
|
The value of value is .
|
The output result is
The code is as follows: |
|
The value of value is my. |
This seems to be no different from form's method = get. haha, the article is here.
There is also a way to get, that is, the form of direct $ _ GET, and view the instance.
The code is as follows: |
|
Apple Orange Mango |
Checkbox. php file code
The code is as follows: |
|
"; Foreach ($ _ GET ["fruit"] as $ value) {Echo $ value ," "; }?> |
The output result is
If you choose Orange and Mango
Note that $ _ GET is not suitable for obtaining a large amount of data. the length value cannot exceed 100 characters.
Original site Original tutorial reprint must indicate the source: http://www.bKjia. c0m/phper/php.html
Bytes. 1. $ _ GET is used to obtain the table method...