The $_get variable is used to collect values from the form method= "get"

Source: Internet
Author: User
Keywords Web Programming PHP Tutorials
Tags .url address address bar array browser echo example get

$_get variable
The $_get variable is an array of variable names and values sent by the HTTP get method.

The $_get variable is used to collect values from the form method= "get". The information sent from a form with a Get method is visible to anyone (it appears in the browser's address bar) and has a limit on the amount of messages sent (up to 100 characters).

Example
<form action= "welcome.php" method= "Get" >
Name: <input type= "text" name= "name"/>
Age: <input type= "text" name= "age"/>
<input type= "Submit"/>
</form> when the user clicks the Submit button, the URL sent is similar to this:

http://www.jzread.com/welcome.php?name=Peter&age=37 "welcome.php" files can now get form data by $_get variables (note that the name of the form field automatically becomes $_ ID key in Get array:

Welcome <?php echo $_get["name";? >.<br/>
are <?php echo $_get["age";?> Perton old! why use $_get?
Note: When you use the $_get variable, all the variable names and values are displayed in the URL. 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 your Favorites folder. In some cases, this is useful.

Note: HTTP Get methods are not suitable for large variable values; values cannot exceed 100 characters.
$_request variable
PHP's $_request variables contain $_get, $_post, and $_cookie content.

PHP's $_request variable can be used to obtain the results of form data sent through the Get and POST methods.

Example
Welcome <?php echo $_request["name";? >.<br/>
You are <?php echo $_request[' age ';?> Perton old!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.