I'm trying to redirect users to a view page (either admin or member) depending on if the password matches in the database. This is giving me the exact opposite of what I want and I'm not seeing the error. A blank form submission or incorrect username/password sends them to the admin page meanwhile correct inputs sends them to members. Why is this working backwards?
public function loginFunc()
{
$username = (string)$this->input->post('username');
$password = (string)$this->input->post('password');
if((strlen($username)<1)||(strlen($password)<1)){
$blank = 1;
}
$actualPass = (string)$this->db->query("SELECT password FROM usersas6 WHERE username = '$username' ");
if($actualPass == $password){
header("Location: /CodeIgniter-3.1.7/index.php/admin");
}else{
header("Location: /CodeIgniter-3.1.7/index.php/members");
}
}