i'm stuck with using $_GET variables with CodeIgniter, anyone can help me please?
-
@diani-chandra-pertiwi Please check an answer if it is correct and acceptable answer of your question. Thanks. – csi May 07 '11 at 21:57
5 Answers
CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided functions rather than fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. In other words, normally you might do something like this:
if (!isset($_GET['something'])){
$something = FALSE;
} else {
$something = $_GET['something'];
}
With CodeIgniter's built in functions you can simply do this:
$something = $this->input->get('something');
Taken from here.

- 1,754
- 1
- 18
- 35
There's no reason that you would be able to use $this->input->get()
and not $_GET
.
You may be running an older version (less than 2.0.1) that does not have real $_GET "support". Old versions intentionally unset the $_GET array, assuming because it made things "difficult" for the developers. There is a query strings setting in version 1.7.2 that is very confusing and does not do what you'd expect. Newer versions support $_GET as expected.
Please see here for more information if this is the case:

- 1
- 1

- 101,186
- 37
- 194
- 228