CodeIgniter Forums

Full Version: Passing $_GET to controller unexpeacted error.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum


When I go to a url say index.php/foo? is will load the page fine but if I go to index.php/foo?bar it will load my default controller.

I am a bit confused I thought you could pass GET vars or I would expect it to through a 404 error.

Any ideas

El Forum

It is not hard to setup

First open up /system/application/config.php

$config['uri_protocol']    = "AUTO";
$config['uri_protocol']    = "PATH_INFO";

and then open up your index.php file and add near the top of the file

Special notice is $input_vars is not safe from sql injection etc... it basically gives you exactly what was inputed you must sanatize this manually via... $this->security->xss_clean() Wink

you may have to also do the Url Suffix as well as its been awhile since I did this trick but that would be the variable
$config['url_suffix'] in the same config file just below the uri_protocol.