用户
 找回密码
 入住 CI 中国社区
搜索
查看: 8594|回复: 3
收起左侧

[已解决] $This->input->get()获取不了数据?

[复制链接]
发表于 2010-7-5 21:56:05 | 显示全部楼层 |阅读模式
/controllers/validate_code.php
PHP复制代码
 
class Validate_code extends Controller {
 
        function Validate_code()
        {
                parent::Controller();  
        }
 
        function index(){
                $this->load->helper("validate_code");
                $validateImg    = new DK_Validate_code();
                $validateImg->makeValidateImg();
        }
       
        function test(){
                echo $this->input->get('name');
                exit;
        }
}
 
复制代码


用URL :http://127.0.0.1:81/ftjob/index.php/validate_code/test/name/444

$this->input->get('name');为何获取不了name值
发表于 2010-7-5 22:11:30 | 显示全部楼层
-_-
http://127.0.0.1:81/ftjob/index.php/validate_code/test/name/444
这里没有 get,get 是
http://127.0.0.1:81/ftjob/index.php?a=b&c=d
中的 a 和 c
要打开 CI 的 GET 请参考论坛 FAQ 置顶帖。
发表于 2010-7-5 22:12:13 | 显示全部楼层
$name=$this->uri->segment(4);
参考http://codeigniter.org.cn/user_guide/general/urls.html
 楼主| 发表于 2010-7-5 22:30:58 | 显示全部楼层
谢谢 楼上两位

本版积分规则