Reputation: 2587
In codeigniter's controller the $_GET['variable']
not working in case 'GET'
for Example:
case 'GET';
if(isset($_GET['variable'])){
//do somthing
}
After URL contains ?variable=1
the if condition always fails I don't know why?
Upvotes: 1
Views: 102
Reputation: 3743
Check this in your config.php
file
$config['allow_get_array'] = TRUE;
and access query string parameters with $this->input->get('variable')
Upvotes: 3
Reputation: 746
Try to use $this->input->post('var')
if($this->input->post('var')){
//do somthing
}
Upvotes: 1
Reputation: 22532
for getting $_GET
value in codeigniter you use:-
parse_str($_SERVER['variable'], $_GET);
and make sure this is true in your config.php file
$config['allow_get_array'] = TRUE;
and you must have to add
$config['uri_protocol'] = "PATH_INFO";
Upvotes: 1