Home >Backend Development >PHP Problem >What does $_post mean in php?

What does $_post mean in php?

(*-*)浩
(*-*)浩Original
2019-09-05 14:32:155241browse

In PHP, the predefined $_POST variable is used to collect values ​​from the form with method="post".

What does $_post mean in php?

$_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[&#39;fname&#39;];
 
$b=$_POST[&#39;age&#39;];
 
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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn