Enabling CodeIgniter $_GET

Written by

in

,

Here is how to enable CodeIgniter support to $_GET and still able to use the normal “SEO-friendly” URL working together.
So you will get a URL like this

http://www.example.com/index.php/the_controller/the_function/?some=thing&more=yes

First approach is modify your “config.php” and change this line.

$config['enable_query_strings'] = true;

But this is not recommended because on pagination, you will get ugly URL.

Second approach is modify your “config.php” and change this line.

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

You can keep this line (notice it is still “false”)

$config['enable_query_strings'] = false;

And on your controller, you can use this code

parse_str($_SERVER['QUERY_STRING'], $get_vars);
echo $get_vars['some'];

Comments

5 responses to “Enabling CodeIgniter $_GET”

  1. Kimi Avatar
    Kimi

    Hi,
    I installed proxycoder-0.0.2.1 but security code is don’t work.
    Please help me.

    Thank you.

    1. Xrvel Avatar

      What do you mean? The security code image can not be displayed at all?

  2. Kimi Avatar
    Kimi

    Images can be displayed, but enter the security code can not login.

    1. Xrvel Avatar

      Is the code already customized? Or even the fresh-downloaded script can not work?

      1. Kimi Avatar
        Kimi

        I don’t know customized?
        What do i do?

Leave a Reply

Your email address will not be published. Required fields are marked *