php中的 file_get_contents(‘php://input’)

index.html

 <formaction="action.php"method="post">
  <inputtype="text"name="userName"  id="userName"/><br/>
  <inputtype="text"name="userPass"  id="userPass"/><br/>
  <inputtype="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/>";
?>

 

 

posted @ 2013-09-13 16:37  adby  阅读(347)  评论(0编辑  收藏  举报