sunn 发表于 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错误页面了,请问如何解决


sunn 发表于 2013-8-28 11:41:04

已解决

马谎言 发表于 2013-9-25 14:14:24

lz怎么解决的我redirect那里也跳转不过去啊

mahuatengBC 发表于 2013-9-25 15:01:18

目录错了吧

小菜鸟 发表于 2013-9-25 17:33:50

学习下{:1_1:}
页: [1]
查看完整版本: (新手)关于跳转问题