Home > Article > Backend Development > What does $_post mean in php?
In PHP, the predefined $_POST variable is used to collect values from the form with method="post".
$_POST variable
The predefined $_POST variable is used to collect data from method="post " value in the form. (Recommended learning: PHP video tutorial)
The information sent from the form with the POST method is invisible to anyone (will not be displayed in the browser's address bar) , and there is no limit on the amount of messages sent.
Note: However, by default, the maximum amount of information sent by the POST method is 8 MB (can be changed by setting post_max_size in the php.ini file).
When to use method="post"?
Information sent from a form with the POST method is invisible to anyone, and there is no limit on the amount of information sent.
However, since the variable does not appear in the URL, the page cannot be bookmarked.
<form action="welcome.php" method="post"> Name:<input type="text" name="fname"> <br /> Age:<input type="text" name="age"> <br /> <input type="submit"> </form> <?php $a=$_POST['fname']; $b=$_POST['age']; echo $a."<br />"; echo $b."<br />"; ?>
The above is the detailed content of What does $_post mean in php?. For more information, please follow other related articles on the PHP Chinese website!