Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to the code

function validate(){
        $this->load->library('session');
        $this->load->model('inventory/inventoryModel');
        $result = $this->inventoryModel->validateUser();
        if($result == 1){
            $data = array(
                'username' => $this->input->post('username'),
                'is_loged_in' => TRUE 
            );
            $this->session->set_userdata($data);
        }
        else{
            $this->index();
            redirect('inventory/validate');
        }
    }

and getting the error in chrome "This web page has a redirect loop" what is solution?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
222 views
Welcome To Ask or Share your Answers For Others

1 Answer

You have

$this->index() 

which probably trying to load views mentioned in the function.

Redirect causing again to load different function.

Sort that out. Can't give the exact solution as this isn't the whole code.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...