I’m using Codeigniter 2.1.3 with Friendly URL (.htaccess).
In Controller:
public function confirm($key) {
var_dump($this->input->get());
}
But link _http://site.com/confirm/12345 returns “boolean false”.
How to enable Query strings in URL, or how to filtering $key ?
My .htaccess:
RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt|files|templates)
RewriteRule ^(.*)$ /index.php?/$1 [L]
You receive
keyas the function argument, so you can do this:http://site.com/confirm/12345will echo12345.Filtering of characters in this can be done via
$config['permitted_uri_chars']inconfig.php.If you want to receive it as a
GETparameter and want to perform XSS filtering on it, the URL needs to behttp://site.com/confirm?key=12345and in your controllerThe second method requires
$config['enable_query_strings']to be set toTRUE.