CodeIgniter Forums
need to use $_GET on one page - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: need to use $_GET on one page (/thread-2190.html)

need to use $_GET on one page - El Forum - 07-21-2007

I am using a third party interface and they will be sending me one parameter in the query string:

Since $_GET is disabled, does anyone know a good way I can get around this? I only need $_GET for this one page.


need to use $_GET on one page - El Forum - 07-21-2007

[eluser][email protected][/eluser]
my english isn't great , so i cut the following piece directly from ci docs.
Quote:Enabling Query Strings
In some cases you might prefer to use query strings URLs:


CodeIgniter optionally supports this capability, which can be enabled in your application/config.php file. If you open your config file you'll see these items:

$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';

If you change "enable_query_strings" to TRUE this feature will become active. Your controllers and functions will then be accessible using the "trigger" words you've set to invoke your controllers and methods:


Please note: If you are using query strings you will have to build your own URLs, rather than utilizing the URL helpers (and other helpers that generate URLs, like some of the form helpers) as these are designed to work with segment based URLs.

need to use $_GET on one page - El Forum - 07-21-2007

[eluser]Glen Swinfield[/eluser]
Perhaps you could use a pre-system or pre-controller hook that checks the URL for a GET var and then saves ti for use in a variable, or session or something.

Also you could use .htaccess mod_rewrite to check the url and redirect to and then deal with the page as usual.

need to use $_GET on one page - El Forum - 07-21-2007

Thanks Codepat.

Those both sound like good ideas. I will try them out.

need to use $_GET on one page - El Forum - 07-21-2007

[eluser]Al James[/eluser]
Hi there...

This thread has a full discussion:


If you only need it in a few pages.

1) Set your config item 'uri_protocol' to 'PATH_INFO'.

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

2) Use this line to rebuild the $_GET array (in your controller)


If you need it site wide

Look at: