Welcome Guest, Not a member yet? Register   Sign In
I cannot receive post data.
#1

[eluser]kjanko[/eluser]
Controller:
Code:
public function login()
    {
        $this->output->enable_profiler(TRUE);
        $this->load->library('trinity');
        $this->load->library('session');
        $username = $this->input->post('username');
        $password = $this->input->post('password');
        var_dump($username);
        var_dump($password);
        if($this->session->userdata('logged_in'))
        {
            show_error('You are already logged in!');
        }
        else
        {
            $this->trinity->Login($username, $password);
            redirect('home');
        }
    }

View:
http://pastebin.com/d1xXswhN

Login function:
Code:
public function Login($username, $password)
    {
        $auth = $this->_obj->config->item('DB_auth');
        $this->_trinity['auth'] = $this->_obj->load->database($auth, TRUE);
        $sha_password = sha1(strtoupper($password));
        $query = $this->_trinity['auth']->select('username, sha_pass_hash')->from('account')->where('username', $username)->where('sha_pass_hash', $sha_password)->get();
        if($query->num_rows() > 0)
        {
            $data = array(
                'username'      => $username,
                'password'      => $password,
                'logged_in'     => TRUE,
                'ip_address'    => $_SERVER['REMOTE_ADDR']
            );
            $this->_obj->session->set_userdata($data);
            redirect('home');
        }
        else
        {
            show_error('Invalid username or password. Please try again.');
        }
    }

$_POST is empty array.


Messages In This Thread
I cannot receive post data. - by El Forum - 06-27-2011, 06:19 PM
I cannot receive post data. - by El Forum - 06-28-2011, 02:06 AM
I cannot receive post data. - by El Forum - 06-28-2011, 05:10 AM
I cannot receive post data. - by El Forum - 06-28-2011, 07:48 AM
I cannot receive post data. - by El Forum - 06-28-2011, 09:16 PM
I cannot receive post data. - by El Forum - 06-29-2011, 03:44 AM
I cannot receive post data. - by El Forum - 06-29-2011, 07:18 AM
I cannot receive post data. - by El Forum - 06-29-2011, 07:29 AM
I cannot receive post data. - by El Forum - 06-29-2011, 07:48 AM
I cannot receive post data. - by El Forum - 06-29-2011, 08:14 AM
I cannot receive post data. - by El Forum - 06-29-2011, 09:00 AM
I cannot receive post data. - by El Forum - 06-30-2011, 10:39 AM
I cannot receive post data. - by El Forum - 06-30-2011, 02:31 PM
I cannot receive post data. - by El Forum - 06-30-2011, 02:39 PM
I cannot receive post data. - by El Forum - 06-30-2011, 02:47 PM
I cannot receive post data. - by El Forum - 06-30-2011, 03:02 PM
I cannot receive post data. - by El Forum - 06-30-2011, 03:09 PM
I cannot receive post data. - by El Forum - 06-30-2011, 03:17 PM
I cannot receive post data. - by El Forum - 06-30-2011, 03:31 PM
I cannot receive post data. - by El Forum - 06-30-2011, 08:24 PM
I cannot receive post data. - by El Forum - 06-30-2011, 08:28 PM
I cannot receive post data. - by El Forum - 07-01-2011, 06:41 AM
I cannot receive post data. - by El Forum - 07-01-2011, 07:18 AM
I cannot receive post data. - by El Forum - 02-17-2014, 03:33 AM
I cannot receive post data. - by El Forum - 02-17-2014, 05:50 AM
I cannot receive post data. - by El Forum - 02-18-2014, 02:46 AM
I cannot receive post data. - by El Forum - 02-18-2014, 02:03 PM
I cannot receive post data. - by El Forum - 02-19-2014, 12:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB