PHP $_post

Source: Internet
Author: User

PHP $_post

The $_post variable is used to collect value in a form and method = "POST".

In the $_post variable
The $_post variable is a variable whose array name and value emit an HTTP POST method.

The $_post variable is used to collect value in a form and method = "POST". One form of information transmission and post methods are invisible to others and there is no limit to the amount of information transmitted.

For 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 will not contain any form of data that looks like this:

 http://www.w3schools.com/ welcome.php 
   
 
     
     

This "welcome.php" file can now use the $ _post variable The amount of data caught in the form (the Name form field of the notification will be the $ _post array in the ID of the auto key):

 

 Welcome <?php echo $_post["name";? >.<br

    /> You are <?php echo $_post[' age ';?> years 
   
 
       
       

Why do you want to use the $ _post?
variables are not displayed after HTTP is emitted
variable has no length limit
However, since the variable does not appear in the URL, it is impossible to bookmark the page. The




$ array Variable
PHP's $_request array variable contains both $ _get, $ _post, and $ _cookie.

PHP's $_request array variable can be used to obtain the get and post methods sent in the form of the result data.

For example

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

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.