Welcome Guest, Not a member yet? Register   Sign In
How can I ignore unwanted query strings in URLs?
#1

[eluser]igniteflow[/eluser]
Hi,

I am building an app in Facebook with CI and things are mostly going well so far. However, sometimes Facebook decides to append query strings to my URL such as ?auth_token=687bb036c99769ee32a8599a83cb6532&installed=1 which not only is not required by my app, but also breaks it.

How can I change my controller to either ignore query strings like this, or store them to a variable which may be used later if required. Any help would be much appreciated.

Thanks
#2

[eluser]Jeremy Gimbel - Conflux Group[/eluser]
What do you mean by ignore them? Are you getting a page not found error when they come through with a query string?

Presumably, if you're not using the GET data, it's being ignored, but sometimes it does mess with the routing or causes an invalid characters error.

You can add the '?' to the valid characters in your config.php.
#3

[eluser]igniteflow[/eluser]
Thanks Jeremy. I found that changing the following two variables in config.php did the job

Code:
$config['uri_protocol'] = "PATH_INFO";

$config['enable_query_strings'] = TRUE;




Theme © iAndrew 2016 - Forum software by © MyBB