【发布时间】:2013-04-05 00:35:45
【问题描述】:
我想从类似于 http://localhost/project/?ref=6 的 URI 中获取 ref 值
现在我知道$_GET['ref'] 在codeigniter 中不起作用。我尝试通过设置$config['allow_get_array'] = TRUE; 来启用它,但它不起作用。
我在某处读到了关于使用$this->input->get('ref') 但没有运气。在使用它之前,我确实在 config.php 中加载了input 库。
注意:我想在模型中访问这个值
在 config.php 中添加
$config['uri_protocol'] = "PATH_INFO";
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?';
并评论了现有的 $config['uri_protocol'] = 'REQUEST_URI'; 和 $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
控制器代码是:
parse_str($_SERVER['QUERY_STRING'], $_GET);
$ref = $this->security->xss_clean($_GET['ref']);
log_message('info','>>>>>>>>>>>>>>>>>>enter email_invites method::'.$ref);
但我仍然没有得到任何价值,而且不知何故我没有看到任何日志消息。
【问题讨论】:
标签: php codeigniter