0

I have been working on a web app that has been previously built/worked on by people I have no way of contacting.

I believe we are currently on CI_VERSION 1.7.0.

I've made sure that enable_query / allow_get_array config vars are all true. I can see the correct values in the header(query string parameters).

Example of the problem below:

//E.g.
//URL: http://www.fakeURL.com/something/stuff?color=blue&gender=boy

var_dump($_GET);
// array(1) { '/something/stuff' => string(0) "" } 
Fjodr
  • 919
  • 13
  • 32
Base Desire
  • 485
  • 1
  • 5
  • 15

3 Answers3

0

Try getting url parameters with build-in class : input.

$p = $this->input->get();
var_dump($p);

Codeigniter recommand to do it this way. For example, you can't get a parameter twice with this function as it is emptied the second time. So we don't know how they manage parameters.

gosp
  • 76
  • 4
0

In earlier versions of CI the $_GET array included the requested controller/method after the URL was rewritten (as detailed in this answer), the rest of the info in it was stored in the input class and removed (see the legacy docs).

As the other answer stated, you'll need to use $this->input->get(); which will contain the original $_GET params.

Community
  • 1
  • 1
Adam Westbrook
  • 1,041
  • 9
  • 13
0

I ended up using this solution, found here: https://stackoverflow.com/a/2283881/1626354

I will say that this is more of a 'work-around' than a solution, but I can't invest anymore time in this right now.

Thanks everyone for your helpful suggestions. Hopefully this will be useful to someone else someday too.

Community
  • 1
  • 1
Base Desire
  • 485
  • 1
  • 5
  • 15