CodeIgniter Forums
page redirection - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: page redirection (/showthread.php?tid=14783)



page redirection - El Forum - 01-14-2009

[eluser]tabatsoy[/eluser]
Greetings Earthlings!!!

Here is my code:
Code:
if ($this->form_validation->run() == FALSE) {
                $this->load->view('admin/login', $data);
            }
            else {
                $query = $this->db->query('SELECT * FROM admin WHERE username = "'.$username.'" AND password = "'.$password.'"');
                
                if ($query->num_rows() < 1) {
                    $data['message'] = 'Invalid Username or Password';
                    
                    $this->load->view('admin/login', $data);
                }
                else {
                    redirect('exam/admin');
                }
            }

My problem is my redirect is not working. I says
An Error Was Encountered

Unable to load the requested file: admin.php


Please help

thanks


page redirection - El Forum - 01-14-2009

[eluser]chandrajatnika[/eluser]
when did you find error message? on success login or failed login??


page redirection - El Forum - 01-14-2009

[eluser]tabatsoy[/eluser]
on the redirect page


page redirection - El Forum - 01-14-2009

[eluser]chandrajatnika[/eluser]
it\'s because file admin.php is not found on folder named \'exam\'


page redirection - El Forum - 01-14-2009

[eluser]Colin Williams[/eluser]
That error is generated when trying to load a view file that does not exist.


page redirection - El Forum - 01-14-2009

[eluser]Tri Dang[/eluser]
Please check admin() method from Exam controller to see what view it loads.