Welcome Guest, Not a member yet? Register   Sign In
Not understanding form validation
#7

[eluser]cominus[/eluser]
Lucky, I am not sure I am understanding what you are saying. So I will post the entire controller. Do you mind explaining it to me in that context? and if you need another file, let me know.
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends CI_Controller {

    function __construct()
    {
        parent::__construct();
        
    }

    function index()
    {
        $this->load->helper('form');
        $this->load->library('form_validation');
        $this->form_validation->set_rules('member_email','Your Email','trim|required|valid_email');
        $this->form_validation->set_rules('password','Password','trim|required|md5');
        
        $data['page_title'] = 'Login';
        $data['page_heading'] = 'Login to the Bomra';

        $this->load->view('header', $data);
        
        if ($this->form_validation->run() == FALSE)
        {
            $this->load->view('loginview', $data);
        } else {            
            $this->load->view('loggedinview', $data);
        }
        
        $this->load->view('footer');
    }
    
    function loggedin()
    {
        $data['page_title'] = 'Loggedin';
        $data['page_heading'] = 'Hey! Hey! You have logged in to the Bomra';
        $this->load->view('header', $data);
        $this->load->view('loggedinview', $data);
        $this->load->view('sidebar');
        $this->load->view('footer');
    }        
    
}

/* End of file login.php */
/* Location: ./application/controllers/login.php */


Messages In This Thread
Not understanding form validation - by El Forum - 04-06-2011, 12:34 PM
Not understanding form validation - by El Forum - 04-06-2011, 01:52 PM
Not understanding form validation - by El Forum - 04-06-2011, 03:08 PM
Not understanding form validation - by El Forum - 04-07-2011, 12:59 AM
Not understanding form validation - by El Forum - 04-07-2011, 10:24 AM
Not understanding form validation - by El Forum - 04-07-2011, 10:44 AM
Not understanding form validation - by El Forum - 04-07-2011, 11:33 AM
Not understanding form validation - by El Forum - 04-07-2011, 12:43 PM
Not understanding form validation - by El Forum - 04-07-2011, 12:46 PM
Not understanding form validation - by El Forum - 04-07-2011, 01:47 PM
Not understanding form validation - by El Forum - 04-07-2011, 04:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB