xcps 发表于 2013-3-9 14:42:49

CodeIgniter 框架中能不能接受全局变量$GLOBALS['HTTP_RAW_POST_DATA']

在做php与flex的交互中,要实现截图上传,用php 来接受并保存数据(用ci框架来做的),因为上传方式是post但是不能为数据命名,所以要用$GLOBALS['HTTP_RAW_POST_DATA']的全局变量,但是在ci框架里不能用,报这样的错误
A PHP Error was encounteredSeverity: Notice
Message: Undefined index: HTTP_RAW_POST_DATA
Filename: controllers/test2.php
Line Number: 15

,请问这个要怎么办!请大神!!!{:soso_e154:}

yunnysunny 发表于 2013-3-10 11:00:56

$xml = file_get_contents(‘php://input‘);

kasindy 发表于 2013-3-11 22:02:41

$HTTP_RAW_POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : file_get_contents("php://input");

Hex 发表于 2013-3-12 09:53:18

同意二楼的方案,file_get_contents(‘php://input‘); 性能比较好。

xcps 发表于 2013-3-16 14:36:16

这个我试了!但是不行啊!!:Q:Q

y45871296 发表于 2013-5-28 10:53:26

顶一下    由什么解决的好办法吗?
页: [1]
查看完整版本: CodeIgniter 框架中能不能接受全局变量$GLOBALS['HTTP_RAW_POST_DATA']