Passing $_GET to controller unexpeacted error. |
[eluser]arbme666[/eluser]
Hi, 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
[eluser]ChrisMiller[/eluser]
It is not hard to setup First open up /system/application/config.php Change Code: $config['uri_protocol'] = "AUTO"; Code: $config['uri_protocol'] = "PATH_INFO"; and then open up your index.php file and add near the top of the file Code: parse_str($_SERVER['QUERY_STRING'],$input_vars); 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() http://ellislab.com/codeigniter/user-gui...urity.html 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. |
Welcome Guest, Not a member yet? Register Sign In |