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.
Folded
Example
<form action= "welcome.php" method= "Get" > Name: <input type= "text" name= "Name"/> Age: <input type= "text" n Ame= "Age"/> <input type= "Submit"/> </form>
When the user clicks the Submit button, the URL is sent like this:
/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
<?php echo $_get["name"];? >.<br/> You are
<?php echo $_get["age"];?>
Years old!
Foldededit this paragraph
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.
Foldededit this paragraph
$_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.
Folded
Example
Welcome
<?php echo $_request["name"];? >.<br/> You is <?php echo $_request["age"];?>
Years old!
PHP $_get