【发布时间】:2016-02-25 08:48:26
【问题描述】:
我想获取查询字符串变量值并在配置文件中允许查询字符串规则。
我的网址:
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
【问题讨论】:
-
您使用标准的codeigniter 格式为
http://localhost/Demo/admin_login/ok并获得价值并获得价值echo $mts =$this->uri->segment(3); -
在您的代码中您错过了操作
index。尝试使用http://localhost/Demo/admin_login/index?mts=ok
标签: php codeigniter query-string