Welcome Guest, Not a member yet? Register   Sign In
unset GET
#1

[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/w...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
        if ($this->allow_get_array == FALSE)
        {
            $_GET = array();
        }
        else
        {
            $_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:
http://localhost/codeigniter/index.php/p...5/6/7/8/10
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 ?
#2

[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')
$vars = $this->uri_to_assoc(3);
// $vars is now: array('cat'=>4, 'region'=>4, 'bla'=>5)
#3

[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,




Theme © iAndrew 2016 - Forum software by © MyBB