I have provided validations for email and password, but even after typing the password, its says "Password is required", So I don't know where I am going wrong. The both email and password should get navigated to next page after typing. Eg : Login Created (Page should be displayed).Please anyone help me because I am new to PHP as well as Codeigniter.
What I have tried:
load->helper('form');
$this->load->helper('url');
$this->load->model('Login_db');
}
/**
* Login Page.
*/
public function index() {
$this->load->view('bootstrap/header');
$login_form_options = array();
// Validation.
$this->load->library('form_validation');
$this->form_validation->set_rules('email','Email','required|valid_email');
$this->form_validation->set_rules('password','Password','required');
//$this->form_validation->set_error_delimiters('
', '
');
if ($this->form_validation->run()== FALSE) {
$this->load->view('login_form', array(
'login_form_options' => $login_form_options,
));
} else {
$this->load->model('Login_db');
$login = new Login_db();
$login->email = $this->input->post('email');
$login->password = $this->input->post('password');
$login->save();
$this->load->view('login_form_success', array(
'login' => $login,
));
}
$this->load->view('bootstrap/footer');
}
}