我根本无法让$ _POST方法起作用。 相反,$ _GET包含数据
我使用Postman通过POST和GET方法进行测试: Screenshot
请求:***。rising-games.net/posttest.php?test=Something
<?php
echo "Request method: " . $_SERVER['REQUEST_METHOD'] . "<br><br>";
//-------------------------------------------
// POST output
//-------------------------------------------
if (isset ($_POST ["test"]))
echo "Post 'Test' is: " . $_POST ['test'] . "<br>";
else
echo "Post 'test' is empty!<br>";
//-------------------------------------------
// Get output
//-------------------------------------------
if (isset ($_GET ["test"]))
echo "Get 'Test' is: " . $_GET ['test'] . "<br>";
else
echo "Get 'test' is empty!<br>";
//-------------------------------------------
// Request output
//-------------------------------------------
if (isset ($_REQUEST ["test"]))
echo "Request 'Test' is: " . $_REQUEST ['test'];
else
echo "Request 'test' is empty!";
&GT;