<?php
print_r($_POST);
echo file_get_contents("php://input");
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form action="test.php" method="post" enctype="multipart/form-data">
<p>标题菜单:<input type="text" name="title"></p>
<input type="submit" value="提交">
</form>
</body>
</html>
print_r($_POST);
echo file_get_contents("php://input");
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form action="test.php" method="post" enctype="multipart/form-data">
<p>标题菜单:<input type="text" name="title"></p>
<input type="submit" value="提交">
</form>
</body>
</html>
一.phpstorm软件本身端口导致的,这类原因我没碰到,但是查资料的时候很多。二.地址写错
这类问题并不是真正的地址写错,有可能是部分写错,写漏。
1.请求的文件并不是你所写的test.php
2.请求的url路径没有写全。 如:
http://example.com/php/index.php?param=1 (完整路径,正确)
http://example.com/php?param=1 (路径缺失,可能导致传参失败)