Login form with email and password from database in php using codeigniter
I am trying to do the login form in codeigniter .when I submit the login form it showing error.


My Controller class

    function validate_credentials()
        {
            $this->load->model('quiz_mode');
            $query = $this->quiz_mode->validate();
                
        if($query) // if the user's credentials validated...
        {
            $data = array(
                'admin_name' => $this->input->post('aname'),
                'is_logged_in' => true
            );
            $this->session->set_userdata($data);
             $this->load->view('logged_in_area');
        }
        else // incorrect username or password
        {
            $this->index();
        }
    }  
My Mode class

    function validate()
        {
            $this->db->where('admin_email', $this->input->post('email'));
            $this->db->where('admin_password', $this->input->post('pwd'));
            $query = $this->db->get("tvr_admin_dt");
    
            if($query->num_rows == 1)
            {
                return true;
            }
    
        }  
My View

    <html>
    <body>
        <form action="<?php echo base_url();?>index.php/quiz/validate_credentials"  method="post">
    <table>
    Email<input type="text" name="email"/> <br /><br />
    
    Password<input type="password" name="pwd"/> <br /><br />
    <input type="submit" value="submit"/>
    <a href="<?php echo base_url();?>index.php/quiz/new_user">new user</a>
    </table>
    </form>
    </body>

    </html>  
when i submitting it showing 

    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined property: Quiz::$session
    
    Filename: controllers/quiz.php
    
    Line Number: 40  

an any one help me…..
Thank in Advance.

Login form with email and password from database in php using codeigniter
===

I am trying to do the login form in codeigniter .when I submit the login form it showing error.


My Controller class

    function validate_credentials()
        {
            $this->load->model('quiz_mode');
            $query = $this->quiz_mode->validate();
                
        if($query) // if the user's credentials validated...
        {
            $data = array(
                'admin_name' => $this->input->post('aname'),
                'is_logged_in' => true
            );
            $this->session->set_userdata($data);
             $this->load->view('logged_in_area');
        }
        else // incorrect username or password
        {
            $this->index();
        }
    }  
My Mode class

    function validate()
        {
            $this->db->where('admin_email', $this->input->post('email'));
            $this->db->where('admin_password', $this->input->post('pwd'));
            $query = $this->db->get("tvr_admin_dt");
    
            if($query->num_rows == 1)
            {
                return true;
            }
    
        }  
My View

    <html>
    <body>
        <form action="<?php echo base_url();?>index.php/quiz/validate_credentials"  method="post">
    <table>
    Email<input type="text" name="email"/> <br /><br />
    
    Password<input type="password" name="pwd"/> <br /><br />
    <input type="submit" value="submit"/>
    <a href="<?php echo base_url();?>index.php/quiz/new_user">new user</a>
    </table>
    </form>
    </body>

    </html>  
when i submitting it showing 

    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined property: Quiz::$session
    
    Filename: controllers/quiz.php
    
    Line Number: 40  

an any one help me…..
Thank in Advance.
