The PHP $ _ POST variable is used to collect values from the form of method = "post.
$ _ POST variable
The $ _ POST variable is an array with the variable name and value sent by the http post method.
The $ _ POST variable is used to collect the values in the form from method = "post. The information sent from a form with the POST method is invisible to anyone (not displayed in the address bar of the browser) and there is no limit on the amount of information sent.
Example
When a user clicks the submit button, the URL does not contain any form data and looks like this:
http://www.w3school.com.cn/welcome.php
The "welcome. php" file can now get form data using the $ _ POST variable (note that the name of the form field will automatically become the ID key in the $ _ POST array ):
Welcome
.
You are
years old!
Why use $ _ POST? Variables sent through http post are not displayed in the URL. The variable has no length limit.
However, because the variables are not displayed in the URL, the page cannot be added to the bookmarks.
$ _ REQUEST variable
The $ _ REQUEST variable in PHP contains $ _ GET, $ _ POST, and $ _ COOKIE content.
The $ _ REQUEST variable of PHP can be used to obtain the results of form data sent through the GET and POST methods.
Example
Welcome
.
You are
years old!