开发者

Codeigniter, WAMP, PHP compatibility problem

开发者 https://www.devze.com 2023-03-28 23:03 出处:网络
I have a piece of code which involves using $this->input->post() of Codeigniter, and it works fine on Bluehost. But when I try it on localhost with WAMP. It won\'t collect any input, even thought I se

I have a piece of code which involves using $this->input->post() of Codeigniter, and it works fine on Bluehost. But when I try it on localhost with WAMP. It won't collect any input, even thought I see in the browser that data has been sent.

I have read that, CI doesn't work with PHP5.3 (which is what I have) (IS THIS TRUE???) then I switched to PHP 5.2.11, now WAMP is not working, stuck at yellow, won't start up.

One way or any other, how to solv开发者_JAVA百科e this POST() issue.

P.S. There seems to be data in php://input, but when I did

    parse_str(file_get_contents('php://input'), $rawdata);

$rawdata becomes empty again.

Update: I'm using the latest php and CI and wamp. I'm trying to post json text.


what version of CI you are using? for version below CI 2.0, you need to make some adjusment on php 5.3, see this post for CI adjustment on php 5.3

and, you can not use file_get_contents to read php streams (php://input), you can use fopen and fread to get the stream contents.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号