The $_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 (it does not appear in the browser's address bar), and there is no limit on the amount of information sent.
Let’s look at the simplest example first
The code is as follows | Copy code | ||||
|
代码如下 | 复制代码 |
You are . |
The code is as follows | Copy code |
You are . |
The output result is
You are Hello
代码如下 | 复制代码 |
The code is as follows | Copy code | ||||
|
radiopost.php file
The code is as follows | Copy code | ||||
|
The code is as follows | Copy code |
checkboxpost.php文件
代码如下 | 复制代码 | ||||
|
The output is in the form of an array
Note:
Variables sent via HTTP POST will not be displayed in the URL.
There is no length limit for variables.
$_POST and php://input can get the value, $HTTP_RAW_POST_DATA is empty
$_POST organizes the submitted data in an associative array, and performs encoding processing on it, such as urldecode, and even encoding conversion .
php://input can obtain unprocessed POST raw data through file reading through the input stream
php://input allows reading POST raw data. It puts less pressure on memory than $HTTP_RAW_POST_DATA and does not require any special php.ini settings. php://input cannot be used with enctype="multipart/form-data".
Expand the post simulation method here
The code is as follows | Copy code |
PHP | http://www.bkjia.com/PHPjc/444695.html
TechArticle