[eluser]stuffradio[/eluser]
I'm testing a login library I made. I'm having problems with my login part.
I'm creating test accounts, and I have some usernames that are similar... but are not the same.
I have one called stuff and the other is stuffradio. I used the same password, but that shouldn't matter.
Code:
function login()
{
if (!isset($this->username, $this->password))
{
return false;
} else {
$query = $this->CI->db->get_where('userstable', array('user' => $this->username, 'pass' => md5($this->password)));
$result = $query->row();
if ($query->num_rows() > 0)
{
if (strlen($result->confirm) > 0):
redirect(site_url("url/index/notconfirmed"));
return false;
else:
$this->CI->session->set_userdata(array('log_in' => $result->user));
redirect(index_page());
return $result->user;
endif;
} else {
$status = "Guest";
$this->CI->session->set_userdata(array('log_in' => $status));
redirect(site_url('url'));
}
}
}
When I login with that code, no matter which username I do... it returns stuffradio even though the post says stuff. Should 'stuff' not be returned instead of 'stuffradio'?