Jakob
Jakob

Reputation: 4854

querystring makes codeigniter fail

I'm using Codeigniter with the mvc, and I'm not using querystrings, but I have this api call to facebook, that returns a querystring.

Only thing is that when I get it back with site.com/controller/method?state=supm&code=supm I get a 310, because I'm not setup to handle querystrings. I can't change the config['uri_protocol'] to 'PATH_INFO', because then only my main page will get displayed, and none of the mvc parameteres will get interpreted (for some reason), so how can I make my page not fail, and still get the code and state from facebook?

Upvotes: 0

Views: 450

Answers (2)

Shomz
Shomz

Reputation: 37711

Check out enabling query strings.

If you still like to preserve your old urls (site/controller/function/parameters), you'll have to insert a hook. This one looks fine (haven't tested it myself though).

Edit: Possible duplicate of this.

Upvotes: 0

Mike S.
Mike S.

Reputation: 1120

Use $this->input->get() (see Input Class), just making sure you have allow_get_array set to TRUE in your config.php file.

I believe this item was added in CI 2.0 and is on by default, so it now allows you to access GET data without needing to use enable_query_strings.

Upvotes: 1

Related Questions