I have used form_validation
on codeigniter 3.0
. it gives an error
Allowed memory size of 134217728 bytes exhausted (tried to allocate 130968 bytes)
Controller Code:
if (isset($_POST['username'])) {
$this->load->library('form_validation');
$this->form_validation->set_rules('username', "Username", "trim|required|min_length[5]|max_length[12]");
$this->form_validation->set_rules('password', "Password", "trim|required|min_length[5]");
if ($this->form_validation->run() == FALSE) {
$this->index();
} else {
$result = $this->admin_model->check_login();
if ($result) {
$user_data = array(
'username' => $_POST['username'],
'logged_in' => TRUE,
);
$this->session->set_userdata($user_data);
} else {
$this->session->set_flashdata('login_failed', 'The login info you entered is invalid');
}
}
}