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

[HELP] (新手)关于跳转问题

[复制链接]
发表于 2013-8-28 10:39:14 | 显示全部楼层 |阅读模式
新手问题,我现在做一个登陆判断,成功后就直接跳转另外一个页面,在CI里面应该是控制器的跳转,然后控制器载入视图,代码如下
        function __construct()
                {
                        parent::__construct();
                        $this->load->library('session');
                        $this->load->database();
                        $this->load->helper('url');
                }
               
                function index()
                {
                        $this->load->view('sys_login');       
                }
                function post()
                {
                        $this->load->database();       
                        $this->load->helper('url');
                        $username = $this->input->post('username',true);
                        $password = $this->input->post('password',true);
                       
                        if($username&&$password)
                        {
                                redirect('/index');
                        }
                }
      index.php代码
                function index()
                {
                                $this->load->view('sys_index');       
                       
                }

但是我这样登陆一下,直接跳转到404错误页面了,请问如何解决


 楼主| 发表于 2013-8-28 11:41:04 | 显示全部楼层
已解决
发表于 2013-9-25 14:14:24 | 显示全部楼层
lz怎么解决的  我redirect那里也跳转不过去啊
发表于 2013-9-25 15:01:18 | 显示全部楼层
目录错了吧
发表于 2013-9-25 17:33:50 | 显示全部楼层
学习下

本版积分规则