CodeIgniter PHP Framework - 需要获取查询字符串

2022-01-16 00:00:00 frameworks php codeigniter

我正在使用 CodeIgniter 创建一个电子商务网站.

I'm creating an e-commerce site using CodeIgniter.

我应该如何获取查询字符串?

How should I get the query string?

我正在使用 Saferpay 支付网关.网关响应将是这样的:

I am using a Saferpay payment gateway. The gateway response will be like this:

http://www.test.com/registration/success/?DATA=<IDP+MSGTYPE%3D"PayConfirm"+KEYID%3D"1-0"+ID%3D"KI2WSWAn5UG3vAQv80AdAbpplvnb"+TOKEN%3D"(unused)"+VTVERIFY%3D"(obsolete)"+IP%3D" 123.25.37.43"+IPCOUNTRY%3D"IN"+AMOUNT%3D"832200"+CURRENCY%3D"CHF"+PROVIDERID%3D"90"+PROVIDERNAME%3D"Saferpay+Test+Card"+ACCOUNTID%3D"99867-94913159"+ECI%3D"2"+CCCOUNTRY%3D"XX"%2F>&SIGNATURE=bc8e253e2a8c9ee0271fc45daca05eecc43139be6e7d486f0d6f68a356865457a3afad86102a4d49cf2f6a33a8fc6513812e9bff23371432feace0580f55046c

为了处理响应,我需要获取查询字符串数据.

To handle the response I need to get the query string data.

抱歉,我没有把问题解释清楚.付款后收到付款网站的响应时出现找不到页面"错误.

Sorry, I haven't explained the problem clearly. I am getting a 'Page not found' error while getting the response from the payment site after payment.

我尝试在 config.php 中使用 uri_protocol = 'PATH_INFO'enable_query_strings = 'TRUE' 启用.在谷歌搜索时,我发现如果我使用 htaccess rewrite 这将不起作用.

I have tried enabling with uri_protocol = 'PATH_INFO' and enable_query_strings = 'TRUE' in config.php. While googling I found this won't work if I use htaccess rewrite.

我已经尝试过更改配置条目,但它不起作用.

I have already tried changing the config entries, but it doesn't work.

推荐答案

可以这样获取:

$this->input->get('some_variable', TRUE);

查看这里了解更多信息.

相关文章