The $_post variable is used to collect values from the form method= "POST"

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

$_post variable
The $_post variable is an array of variable names and values that are sent by the HTTP POST method.

The $_post variable is used to collect values from the form from the method= "POST." Information sent from a form with a POST method is not visible to anyone (not shown in the browser's address bar), and there is no limit to the amount of information sent.

Example
<form action= "welcome.php" method= "POST" >
Enter your name: <input type= "text" name= "name"/>
Enter your Age: <input type= "text" name= ' age '/>
<input type= "Submit"/>
</form> when the user clicks the Submit button, the URL does not contain any form data and looks like this:

http://www.jzread.com/welcome.php "welcome.php" files can now get form data by $_post variables (note that the name of the form field automatically becomes the ID key in the $_post array):

Welcome <?php echo $_post["name";? >.<br/>
are <?php echo $_post["age";?> Perton old! why use $_post?
Variables sent over HTTP POST are not displayed in the URL.
Variable has no length limit.
However, because the variable does not appear in the URL, all pages cannot be bookmarked.
$_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.