Welcome Guest, Not a member yet? Register   Sign In
Accessing get data - best way to do it? [SOLVED]
#1

[eluser]Shodan[/eluser]
Hi there,

I'm integrating a CI based site with a payment gateway which provides a facility to call back a given page and passes it order data via query strings.

Unfortunately, there's no option for configuring this as far as I can see, so I'm stuck with the query strings.

What's the best way to access this data?

I've got it working by turning on 'enable_query_strings' in the config.php but I assume this is global for the whole site and seems like overkill just for one page.

Is there a more secure method of accessing query strings on a per page basis that I've overlooked?

I know very little about mod_rewrite and .htaccess files by the way, so before anyone points me in that direction, could they provide some examples?

Many thanks in advance, guys.

Cheers,
Terry
#2

[eluser]Shodan[/eluser]
Sorry guys, I should have looked a bit harder before I posted!

I've realised you can access an array of query string values using $this->input->server("QUERY_STRING") without having to turn on enable_query_strings.

Thanks anyway for anyone that read this!
#3

[eluser]passenger[/eluser]
Any chance you could post a working code example.

I have tried to access $this->input->server("QUERY_STRING"), but it doesn't include the ? parameters coming back from the gateway.

For example, hitting the URL:

Code:
http://www.domain.com/callback?foo=bar

Then in the code:

Code:
class Callback extends Controller {

    function Callback()
    {    
        parent::Controller();

    }
    
    function index () {
       echo "Query String is: " . $this->input->server("QUERY_STRING")

    }

}

Will result in

Quote:Query String is: callback/

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB