回调帖子变量“消失”

发布于 2024-12-08 13:18:02 字数 572 浏览 0 评论 0原文

伙计,我很困惑,你可能无法提供帮助,但也许如果我在这里详细说明一下:

这是一个 CodeIgniter 自定义 CMS。

我正在对别人编写的自定义 cms 进行故障排除;具体来说,其中一个支付网关(HSBC - 与 PayPal 等类似的类型库,但使用 Curl )

它有一个来自银行站点的回调函数,返回一组 $_POST 变量。

问题:$_POST 变量无法从应用程序的控制器访问(我可以看到它们通过使用 httpFox 返回)

我可以:

1)返回到非应用程序 .php 页面和 print_r($_POST) (即,回调 url 只是另一个我的服务器上的页面,在 CI 之外)

2)从应用程序内部或外部向可疑控制器发布表单,并且 print_r($_POST) 没有任何问题(即,该控制器/应用程序可以接收正常的帖子)

因此,尝试从回调本身读取 $_POST 结果是失败的。

关于检查什么或如何跟踪有什么想法吗?显然是某个地方的某种设置,也许是 Curl 的设置,但我不知所措。一旦我弄清楚 TIA 的发展方向

杰夫,很高兴发布代码/更多信息

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

以酷 2024-12-15 13:18:02

在 CodeIgniter 中获取 POST 变量是通过输入类实现的。
文档指出所有超全局变量都被销毁。

获取 $_POST['something'] 的内容应该通过以下方式完成:

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

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');
吃颗糖壮壮胆 2024-12-15 13:18:02

好吧,仔细观察最终发现了这一点:

以前的开发人员拥有 .htaccess 首先添加尾部斜杠,然后删除 .index.php?

回调似乎被路由到自身,并且作为过程的一部分(也许还有一些配置设置)正在丢失帖子变量。不确定这是否是准确的描述,但它通过系统路由了两次,

谢谢

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文