CodeIgniter Forums

Full Version: unset GET
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I have read the documentation. Is their a good reason why the 2 systems could not run in parallel ?

For example have this link
and also have this:
do the same thing

Can someone explain why the GET variables are unset using this code, in the Input class, function _sanitize_globals() method?

// Is $_GET data allowed? If not we'll set the $_GET to an empty array
        if ($this->allow_get_array == FALSE)
            $_GET = array();
            $_GET = $this->_clean_input_data($_GET);
I also works if with routes: http://localhost/codeigniter/index.php/product/1?xx=2
$route['product/(:num)'] = "welcome/test/$1/"; { ["xx"]=> string(1) "2" }

Very good framework, simple organized and well commented.
I am asking this because it may be simple to have a method called test with 2 parameters but what happens when i have something like:
it would be much better to have it general until a certain point, then have ?cat_id=4&region_id=4&bla_id=5, what do you think ?

El Forum

I'm not sure about this, but I think some web servers regard the url as index.php?welcome/test/3 so in that case the query string IS being used, only in a different way.

What I DO know for sure is that you can use $this->uri->uri_to_assoc($n) to achieve what you want. $n is the first segment you want to tread 'associatively'. That way you can still use 'fixed' parameters in the first part of the url.
For example:
// uri : (this is using .htaccess to remove 'index.php')
$vars = $this->uri_to_assoc(3);
// $vars is now: array('cat'=>4, 'region'=>4, 'bla'=>5)

El Forum

I do not think apache does this url rewrite
give me the following:
REQUEST_URI] => /test/index.php/ff/cc/test.php?var=23
[SCRIPT_NAME] => /test/index.php
[PATH_INFO] => /ff/cc/test.php
[PATH_TRANSLATED] => D:\wamp\www\ff\cc\test.php
[PHP_SELF] => /test/index.php/ff/cc/test.php

[QUERY_STRING] => var=23
so apache does not change anything.

Thanks for the example,