2010-07-24 62 views
0

我见过几个例子,但我似乎无法得到它的工作。

的config.php:

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

库:

class MY_Input extends CI_Input 
{ 
    function _sanitize_globals() 
    { 
     $this->allow_get_array = TRUE; 
     parent::_sanitize_globals(); 
    } 
} 

控制器:

$this->load->library('MY_Input'); 
.................. 

$sid=$this->input->get('sid',TRUE); 
$name=$this->input->get('name',TRUE); 
$campid=$this->input->get('campid',TRUE); 
$rate=$this->input->get('rate',TRUE); 
$status=$this->input->get('status',TRUE); 

这里的网址:

www.mysite.com/memb/index/postback.php?campid=23552342&name=mcamp&rate=15&sid=42&status=1&ip=198152999000 

会发生什么,它只是进入我的主页,并没有更新数据库,它不会去我在控制器中添加的测试视图页面,看看是否会加载视图。

编辑:现在看来,如果我尝试加载其他视图我总是最后在家里看...

回答

1

把这个在你的控制器

parse_str($_SERVER['QUERY_STRING'],$_GET); 

然后你可以使用你的$ _GET像正常的变量...即。回声$ _GET [ '变种']

0

我认为你需要做的就是打开的application/config/config.php文件文件,然后:

$config['uri_protocol'] = "PATH_INFO"; 
$config['permitted_uri_chars'] = 'a-z ? 0-9~%.:_\-'; 
+0

它只有ORIG_PATH_INFO工作。谢谢 – JEagle 2010-07-27 11:40:04