Php $ _ get [] usage. In the php Tutorial, you must use METHODGET to get the data of the form. Otherwise, the value cannot be obtained normally. The $ _ GET variable is an array, the content is the variable $ _ get sent by the httpget method in the php Tutorial. to obtain the data of the form, you must set METHOD = GET. Otherwise, the value cannot be obtained normally,
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 ).
View an instance for obtaining form data
// Properly determining which submission button was clicked in PHP:
If (isset ($ _ GET ['submit _ one_x ']) {
} Elseif (isset ($ _ GET ['submit _ two_x ']) {
} Else {
}
?>
Instance 2
If ($ _ GET ['Time'] + 300> = time ()){
Echo "You took too long!
";
Exit;
}
?>
Operation select value
ABCD
// The PHP code to access which value (s) were selected:
Foreach ($ _ GET ['myselect'] as $ val ){
Echo "You selected: $ val
";
}
Echo "You selected". count ($ _ GET ['myselect']). "Values .";
?>
Obtain the data submitted by the form and then output it. this is also a complete instance.
A Simple HTML Form
// Index. php
Print "Welcome". $ _ GET ['user']."
Nn ";
Print "Your address is:
". $ _ GET ['address']."";
?>
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.
Variable, $ _ GET variable is an array, and the content is the variable sent by the http get method...