Welcome Guest, Not a member yet? Register   Sign In
Form Error on multiple submission
#1

[eluser]Mark75[/eluser]
Hi all,
i'm running into an error and don't know how to fix it. i have a login function looking like this:

Code:
function login()
{
    $this->form_validation->set_rules('uid', 'uid', 'required|trim');
    $this->form_validation->set_rules('pwd', 'uid', 'required|trim|callback__check_user');
    if ( $this->form_validation->run() == FALSE )
    {
        $this->load->view('login');
    }
    else
    {
        $fields = array(
            'login_date' => date('Y-m-d H:i:s'),
            'login_ip' => $this->input->ip_address()
            );
        if ($this->admin_model->save($fields))
        {
            redirect('admin');
        }
        else
        {
            die('error');
        }
    }
}

This works fine until the loginform is submitted more than one time. In that case the error is displayed. I already have disabled the submit-button with javascript after it is submitted, but i also need something server-side. Could someone provide any hints about that?

Thank you!
Mark




Theme © iAndrew 2016 - Forum software by © MyBB