1

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');
            }
        }
    }
Nana Partykar
  • 10,556
  • 10
  • 48
  • 77
Manish Tiwari
  • 1,806
  • 10
  • 42
  • 65

1 Answers1

0

Increase your memory size in php.ini file. It will solve your problem.

memory_limit = 12M

or use

ini_set(“memory_limit”,“12M”);

in codeigniter.

safin chacko
  • 1,345
  • 1
  • 11
  • 18