开发者

callback post vars "disappearing"

man, I am stumped, and you probably won’t be able to help, but perhaps if I talk it through here:

This is a CodeIgniter custom CMS.

I am troubleshooting a custom cms someone else wrote; specifically, one of the payment gateways (HSBC - similar type library as PayPal or the like, but using Curl )

It has a callback function from the bank’s site, returning a set of $_POST variables.

PROBLEM: The $_POST variable are not accessible from app’s controller (I can see them returned by using httpFox)

I CAN:

1) return to a non-app .php page and print_r($_POST) (i.e., callback url is just another page on my server, outside of CI)

2) post a Form from within or outside the app to the suspect controller, and print_r($_POST) with no trouble (i.e., this controller/app CAN receive a normal post)

So开发者_开发知识库, trying to read the $_POST results from the callback itself is what is failing.

Any ideas on what to check, or how to track this? It’s obviously some setting somewhere, perhaps with Curl, but I’m at a loss. Happy to post code/more info once I figure out what direction to go in

TIA,

jeff


Getting POST variables in CodeIgniter is acheived through the input class. The documentation states that all the superglobal variables are destroyed.

Getting the content of $_POST['something'] should then be done by:

$something = $this->input->post('something');


ok, a little closer observation final tracked it down:

the previous developer had the .htaccess to first add a trailing slash, then remove the .index.php?

it seems the callback was being routed to itself and as part of the process (along with some config settings, maybe) was losing the post vars. not sure if that's a precise description, but it was routing twice through the system

thanks

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜