KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to direct the user to my main page when the user is authorized. I am doing the user check in my login_check controller and add $this->load->view('main'); The page can be load but the site address in the main page still show http://myprojectname/login_check but I want it to show http://myprojectname/main . Do i have to create a new 'main' controller and load the view? It sounds redundant to me. Here is my code. part of my login_check.php private function _user_check() { $this->load->model('user_query'); //load my model $result=$this->user_query->query($this->input->post('username'),$this->input->post('password')) if($result) //the user is in DB { $data['view']='main'; $this->load->view('include/template', $data); //the address bar shows http://myproject/login_check in main page }else{ //the user is not in DB $data['view']='login'; $this->load->view('include/template', $data); } }
Tags (comma-separated)
Save Edits
Cancel