CodeIgniter Forums
URL routing with query_strings_enabled not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: URL routing with query_strings_enabled not working (/showthread.php?tid=19844)



URL routing with query_strings_enabled not working - El Forum - 06-20-2009

[eluser]topherdan1[/eluser]
Hello,

I am trying to allow my application to use query strings while still keeping the friendly URL routing. I have followed the instructions of updating enable_query_strings in the config file and then trying uri_protocol = PATH_INFO, REQUEST_URI, and the others. However I still am not able to see the GET variables in my controllers.

It seems like people have had the most success with PATH_INFO as the uri_protocol. When I print_r($_SERVER[]), however, the PATH_INFO variable is not there. I am using a standard installation of wamp on Windows Vista.

Anyone have a suggestion?

Thanks!


URL routing with query_strings_enabled not working - El Forum - 06-20-2009

[eluser]n0xie[/eluser]
Try this http://ellislab.com/forums/viewthread/120460/


URL routing with query_strings_enabled not working - El Forum - 06-20-2009

[eluser]topherdan1[/eluser]
Thanks for the reply.

Yes, I gave that a try. The GET variables are still not made available in the controller. Also, when I try to use get variables on the front page (ie http://localhost/?test=true) the code throws an error (<p>Severity: Notice</p>
<p>Message: Undefined offset: 0</p>
<p>Filename: libraries/Router.php</p>
<p>Line Number: 207</p>)

Any ideas on how to get PATH_INFO to work?


URL routing with query_strings_enabled not working - El Forum - 06-20-2009

[eluser]TheFuzzy0ne[/eluser]
If I remember correctly, you need to use $this->input->get() to grab something from a query string.


URL routing with query_strings_enabled not working - El Forum - 06-20-2009

[eluser]topherdan1[/eluser]
Yes, I am trying to print my variables using that function. For example, I am opening: http://localhost/users/?test=true and then trying: print_r($this->input->get('test')) but it returns nothing. I still think it may have something to do with PATH_INFO not functioning.