Home  >  Article  >  Backend Development  >  What does $_post mean in php

What does $_post mean in php

藏色散人
藏色散人Original
2020-10-19 11:44:316585browse

$_post in php refers to the predefined $_POST variable, which is used to collect values ​​from the form with "method="post""; the information sent from the form with the POST method is valid for any People are invisible, and there are no limits on how much messages can be sent.

What does $_post mean in php

Recommended: "PHP Video Tutorial"

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

$_POST variable

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

Information sent from a 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 information 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).

Example

form.html file code is as follows:

<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body>
<form action="welcome.php" method="post">
名字: <input type="text" name="fname">
年龄: <input type="text" name="age">
<input type="submit" value="提交">
</form>
</body>
</html>

When the user clicks the "Submit" button, the URL is similar to the following:

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

" welcome.php" file can now collect form data via the $_POST variable (note that the names of the form fields automatically become keys in the $_POST array):

欢迎 <?php echo $_POST["fname"]; ?>!<br>
你的年龄是 <?php echo $_POST["age"]; ?>  岁。

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