PHP $_get

Source: Internet
Author: User

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

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.