php中的 file_get_contents(‘php://input’)
今天用CI框架整合微信发现了一个没见过的 file_get_contents('php://input'); 这个家伙是干嘛用的,然后自己直接写了验证的代码。好吧 废话不多说直接看下面的代码。
<?php
$raw_post_data = file_get_contents('php://input');
echo "-------\$_POST------------------<br/>";
echo var_dump($_POST) . "<br/>";
echo "-------php://input-------------<br/>";
echo $raw_post_data . "<br/>";
?>
<form action="a.php" method="post" >
<input type="text" value="zhangsan" name="name"/></br>
<input type="password" value="zhangsan" name="pwd"/></br>
<input type="submit" value="提交" /></br>
</form>
--------------------------------------
提交后显示的结果为:
-------$_POST------------------
array() { ["name"]=> string() "zhangsan" ["pwd"]=> string() "zhangsan" }
-------php://input-------------
name=zhangsan&pwd=zhangsan
php中的 file_get_contents(‘php://input’)的更多相关文章
- php中的 file_get_contents(‘php://input’)用法
php中的 file_get_contents('php://input')用法: file_get_contents 获取php页面中input内容的值: eg: php: 页面提交了usernam ...
- **对比$_POST、$GLOBALS['HTTP_RAW_POST_DATA']和file_get_contents('php://input')
最近在开发微信接口,又学到了一些新的技术点,今天就把学到的关于接收数据的技术点给简单的罗列下. public function __construct($token, $wxuser = ''){ $ ...
- (转载)file_get_contents("php://input")
(转载)http://taoshi.blog.51cto.com/1724747/1165499 $data = file_get_contents("php://input"); ...
- file_get_contents("php://input")的使用方法
$data = file_get_contents("php://input"); //input 是个可以访问请求的原始数据的只读流. POST 请求的情况下,最好使用 php: ...
- file_get_contents("php://input")的用法
$data = file_get_contents("php://input"); php://input 是个可以访问请求的原始数据的只读流. POST 请求的情况下,最好使用 ...
- 【转】file_get_contents("php://input")的使用方法
$data = file_get_contents("php://input"); php://input 是个可以访问请求的原始数据的只读流. POST 请求的情况下,最好 ...
- file_get_contents("php://input")
$data = file_get_contents("php://input"); php://input 是个可以访问请求的原始数据的只读流. POST 请求的情况下,最 ...
- file_get_contents('php://input') 数据如何转换成数组
前台表单页:demo01.html 后台:demo01.php 输出结果: 备注:若前台通过Ajax的post提交过来的是json数据,需要对json数据进行解析:$data = json_decod ...
- PHP中fopen,file_get_contents,curl函数的区别
PHP中fopen,file_get_contents,curl函数的区别 1.fopen/file_get_contents每次请求都做DNS查询,并不对DNS的信息进行缓存,而curl会对DNS的 ...
随机推荐
- 我的Android进阶之旅------>Android实现音乐示波器、均衡器、重低音和音场功能
本实例来自于<疯狂Android讲义>.要实现详细的功能,须要了解下面API: MediaPlayer 媒体播放器 Visualizer 频谱 Equalizer 均衡器 BassBoo ...
- 重构wm_concat,采用clob做为存储容器
--Type CREATE OR REPLACE TYPE zh_concat_im AUTHID CURRENT_USER AS OBJECT ( CURR_STR clob, STATIC FUN ...
- recess----2.Controller里面取用request信息
事实上,第一个APP里面除了没有model,其它的都有用过了,但是需要单独拎出来看看清楚. Recess框架里面的controller就是一个典型的MVC框架的controller,它负责处理从浏览器 ...
- 关于Eric 6的后端调试器无法启动错误 [The Debugger backend could not be started]
声明: 1)本文由我bitpeach原创撰写.本篇如有转载,请注明来源. 2)本篇主要谈Eric6的一个怪异错误.因为篇幅不长,只是一个短记,以备档查阅. 1.1 软件环境 (1)Eirc6 ,版本号 ...
- js 创建数组方法以及区别
示例代码: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF ...
- canvas贝济埃曲线
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- location.href
location.href用法 CreateTime--2018年2月22日15:22:02 Author:Marydon 1.在当前页面打开URL页面 // 方式一 window.locatio ...
- 云、Iaas、Paas、Saas
云服务现在已经快成了一个家喻户晓的词了.如果你不知道PaaS, IaaS 和SaaS的区别,那么也没啥,因为很多人确实不知道. 云其实是互联网的一个隐喻,云计算其实就是使用互联网来接入存储或者运行在远 ...
- Springmvc UPDATE 数据时 ORA-01858:a non-numeric character was found where a numeric was expected
ORA-01858:a non-numeric character was found where a numeric was expected 异常. 我的代码: 主要是绑定变量带出来的问题. 出错 ...
- 利用POI进行Excel的导出
需求:将用户的违约金信息导出为excel表格格式 步骤 1. 数据库中增加按钮的值(注意上级编号要和页面隐藏域中的相等) DZ内容(页面加载时根据SJBH查询数据库内容,读取DZ字段信息并加载样式及方 ...