Search code examples
htmlcodeigniterpostget

GET parameters in the URL with CodeIgniter


I know that codeIgniter turns off GET parameters by default.

But by having everything done in POST, don't you get annoyed by the re-send data requests if ever you press back after a form submission?

It annoys me, but I'm not sure if I want to allow GET purely for this reason.

Is it such a big security issue to allow GET parameters too?


Solution

  • When I first started working with CodeIgniter, not using GET really threw me off as well. But then I realized that you can simulate GET parameters by manipulating the URI using the built-in URI Class. It's fantastic and it makes your URLs look better.

    Or if you really need GETs working you can put this into your controller:

    parse_str($_SERVER['QUERY_STRING'], $_GET); 
    

    Which will put the variables back into the GET array.