![]() |
unset GET - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: unset GET (/showthread.php?tid=31502) |
unset GET - El Forum - 06-22-2010 [eluser]mironcaius[/eluser] Hello, I have read the documentation. Is their a good reason why the 2 systems could not run in parallel ? For example have this link http://localhost/codeigniter/index.php/welcome/test/?xx=3 and also have this: http://localhost/codeigniter/index.php/welcome/test/3/ do the same thing Can someone explain why the GET variables are unset using this code, in the Input class, function _sanitize_globals() method? Code: // Is $_GET data allowed? If not we'll set the $_GET to an empty array $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: http://localhost/codeigniter/index.php/product/1/2/3/4/5/6/7/8/10 it would be much better to have it general until a certain point, then have ?cat_id=4®ion_id=4&bla_id=5, what do you think ? unset GET - El Forum - 06-22-2010 [eluser]mddd[/eluser] 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: Code: // uri : www.example.com/welcome/test/cat/4/region/4/bla/5 (this is using .htaccess to remove 'index.php') unset GET - El Forum - 06-22-2010 [eluser]mironcaius[/eluser] I do not think apache does this url rewrite http://localhost/test/index.php/ff/cc/test.php?var=23 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, |