Phppost: submit data $ _ POST is empty. file_get_content (php: input) can be obtained. Why? The Code submitted by using the form installed with MAMP in the environment is as follows: {code...} doLogin. php code: {code...} the result of capturing packets with a vase:
Php post submit data $ _ POST is empty file_get_content (php: // input) can be obtained. Why?
The environment is installed with MAMP
The Code submitted by form is as follows:
The doLogin. php code is as follows:
include_once '../include.php';$username = $_POST['username'];$password = md5($_POST['password']);$verify = $_POST['verify'];$session_verify = $_SESSION['verify'];var_dump($_POST);var_dump($_SERVER);
Result of capturing packets with vase:
Reply content:
Php post submit data $ _ POST is empty file_get_content (php: // input) can be obtained. Why?
The environment is installed with MAMP
The Code submitted by form is as follows:
The doLogin. php code is as follows:
include_once '../include.php';$username = $_POST['username'];$password = md5($_POST['password']);$verify = $_POST['verify'];$session_verify = $_SESSION['verify'];var_dump($_POST);var_dump($_SERVER);
Result of capturing packets with vase:
Firstphp://inputYesphp.iniYou can directly obtain the original post data.
While$_POSTIt is subject to the limitation of the header. The English Manual (the Chinese manual does not contain this section, it is omitted) has the following introduction:
An associative array of variables passed to the current script via the http post method when using application/x-www-form-urlencoded or multipart/form-data as the HTTP Content-Type in request.
That's yours.Content-TypeOnly yesapplication/x-www-form-urlencodedOrmultipart/form-dataThe predefined variable $ _ POST will be included.
Another scenario can be used.$HTTP_RAW_POST_DATA.php://inputThe obtained data is the same, but this variable isphp.iniOptions inalways_populate_raw_post_data.
Form action = "doLogin. php" Here, write the action address to the full path.
Action = "./doLogin. php"