xingch 发表于 2010-7-5 21:56:05

$This->input->get()获取不了数据?

/controllers/validate_code.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值

Hex 发表于 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 置顶帖。

visvoy 发表于 2010-7-5 22:12:13

$name=$this->uri->segment(4);
参考http://codeigniter.org.cn/user_guide/general/urls.html

xingch 发表于 2010-7-5 22:30:58

谢谢 楼上两位
页: [1]
查看完整版本: $This->input->get()获取不了数据?