【发布时间】:2016-02-25 11:51:50
【问题描述】:
我在codeigniter 3.0 上使用过form_validation。它给出了一个错误
允许的内存大小为 134217728 字节已用尽(试图分配 130968 字节)
控制器代码:
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');
}
}
}
【问题讨论】:
-
你能在$this->admin_model->check_login()中显示查询吗? ?
标签: php codeigniter validation