如何在编码器点火器中获取查询字符串变量值


How can i get query string variable value in codeigniter?

我想获取查询字符串变量值,并在配置文件上允许查询字符串规则。

我的网址 :

http://localhost/Demo/admin_login/?mts=ok

我在配置文件中做了:

 $config['allow_get_array'] = TRUE;
 $config['enable_query_strings'] = TRUE;
 $config['uri_protocol'] = 'PATH_INFO';

在控制器中,我回应了这一点

echo $_GET['mts'];

我收到此错误:

Message:  Undefined index: mts

更改您的 .htaccess 以删除 ?(如果存在)在重写规则中

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

尝试如何让 CodeIgniter 接受"查询字符串"URL?