Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeIgniter PHP Framework - Need to get query string

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

How should I get the query string?

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.

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.

like image 823
Siva Avatar asked Jan 31 '10 09:01

Siva


People also ask

How to use query in codeigniter?

To submit a query, use the following function: $this->db->query('YOUR QUERY HERE'); The query() function returns a database result object when "read" type queries are run, which you can use to show your results. When "write" type queries are run it simply returns TRUE or FALSE depending on success or failure.

What is PHP query string?

A query string is a term for adding/passing data in the URL. It is not language specific.

What is query string in codeigniter?

CodeIgniter Query String Example: This article shows you how to enable query string in codeigniter. PHP Codeigniter framework uses segment based approach for its URLs, thus making them Search Engine friendly. But those who want to use the good old query string method can turn on this option in code igniter and use it.

What is $this in codeigniter?

In terms of codeigniter: You'll notice that each controller in codeigniter extends the base controller class. Using $this in a controller gives you access to everything which is defined in your controller, as well as what's inherited from the base controller.


1 Answers

You can get it like this:

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

See this for more info.

like image 124
Sarfraz Avatar answered Sep 19 '22 18:09

Sarfraz