Enabling $_GET in codeigniter
Solution 1:
Add the following library to your application libraries. It overrides the behaviour of the default Input library of clearing the $_GET array. It allows for a mixture of URI segments and query string.
application/libraries/MY_Input.php
class MY_Input extends CI_Input
{
function _sanitize_globals()
{
$this->allow_get_array = TRUE;
parent::_sanitize_globals();
}
}
Its also necessary to modify some configuration settings. The uri_protocol setting needs to be changed to PATH_INFO and the '?' character needs to be added to the list of allowed characters in the URI.
application/config/config.php
$config['uri_protocol'] = "PATH_INFO";
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?';
It is then possible to access values passed in through the query string.
$this->input->get('x');
Solution 2:
From the CodeIgniter's manual about security:
GET, POST, and COOKIE Data
GET data is simply disallowed by CodeIgniter since the system utilizes URI segments rather than traditional URL query strings (unless you have the query string option enabled in your config file). The global GET array is unset by the Input class during system initialization.
Read through this forum entry for possible solutions (gets interesting from halfway down page 1).