Welcome Guest, Not a member yet? Register   Sign In
Processing query strings
#1

[eluser]wyred[/eluser]
I have a hosting account at DreamHost and my .htaccess seems to have a problem running on their servers.

Basically, query strings in my URL don't work. I've posted about it before here: http://ellislab.com/forums/viewthread/92609/#792808

So now, I wrote a little function in my custom main controller which is called everytime at __construct().

Code:
function extract_querystrings() {
    $uri = $_SERVER['REQUEST_URI'];
    $uri = explode('?',$uri);
    if (count($uri)>1) {
        foreach($uri AS $ur) {
            $ur = explode('&',$ur);
            foreach($ur AS $u) {
                $u = explode('=',$u);
                if ($u[0]=='/') continue;
                $this->query_strings[$u[0]] = $this->input->xss_clean($u[1]);
            }
        }
    }
    //echo '<pre>',print_r($this->query_strings,true),'</pre>';
}

I have 2 questions,

1) Is there a better way, than mine, to extract the query string values into variables?

2) Did I use xss_clean() at the right place? Should I use it right at the start instead?
e.g.
Code:
$uri = $this->input->xss_clean($_SERVER['REQUEST_URI']);




Theme © iAndrew 2016 - Forum software by © MyBB