file_get_contents("php://input", "r")实例介绍
时间:2021-03-15 09:49:55|栏目:PHP代码|点击: 次
解释不清,直接上例子
index.html
<form action="action.php" method="post" >
<input type="text" name="userName" id="userName" /><br/>
<input type="text" name="userPass" id="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/>";
?>
index.html
复制代码 代码如下:
<form action="action.php" method="post" >
<input type="text" name="userName" id="userName" /><br/>
<input type="text" name="userPass" id="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/>";
?>

上一篇:PHP实现百度人脸识别
栏 目:PHP代码
下一篇:PHP实现微信对账单处理
本文标题:file_get_contents("php://input", "r")实例介绍
本文地址:http://www.codeinn.net/misctech/80985.html






