file_get_contents("php://input", "r")实例介绍
file_get_contents("php://input", "r")实例介绍
解释不清,直接上例子index.html
复制代码 代码如下:
<form action="action.php" method="post" >
<input type="text" name="userName" /><br/>
<input type="text" name="userPass" /><br/>
<input type="submit" value="ok" />
</form>
action.php
复制代码 代码如下:
<?php
$raw_post_data = file_get_contents('php://input', 'r');
echo "-------$_POST------------------<br/>";
echo var_dump($_POST) . "<br/>";
echo "-------php://input-------------<br/>";
echo $raw_post_data . "<br/>";
?>
