sswy86 发表于 2012-8-30 12:42:57

ci 获取参数

直接输入路径
http://localhost/ci/index.php/welcome/index/a/99
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {
        public function index()
        {
        var_dump($_REQUEST);
                $this->load->view('welcome_message');
        }
}

无法取到参数 什么问题?:L

sswy86 发表于 2012-8-30 12:46:13

http://localhost/ci/index.php/welcome/index?a=99
这样就可以获得参数

phptree 发表于 2012-8-30 14:30:39

http://codeigniter.org.cn/user_guide/libraries/uri.html

qq494686707 发表于 2012-8-31 10:46:58

你的 URL 是要通过 $this->uri->segment(URL段) 来获取参数

asqd5200 发表于 2012-8-31 12:38:07

这样能获取到吗??

zdkmyheart1990 发表于 2012-9-1 09:27:06

看来你得先看看uri的规则了。
页: [1]
查看完整版本: ci 获取参数