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

What does $_post mean in php?

(*-*)浩
Release: 2023-02-23 17:12:01
Original
5242 people have browsed it

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 />";
?>
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template