i made the login, the rules if the login true, the login will enter to next form, if another one input true show nottification "username and password not valid, and if all input false back to form login. the error said in form 31 but i think the syntax are correct, what's wrong about the syntax ?
this is codeigniter 3.10 and PHP 7, line 31 in syntax $num_account = count($temp_account);
this is the controller
public function login()
{
$username = $this->input->post('username','true');
$password = $this->input->post('password','true');
$temp_account = $this->user_model->check_user_account($username,$password)->row();
//check account
$num_account = count($temp_account);
$this->form_validation->set_rules('username','Username','required');
$this->form_validation->set_rules('password','Password','required');
if($this->form_validation->run()==FALSE)
{
$this->load->view('account/form_login');
}
else {
if ($num_account > 0) {
//kalau ada set session
$array_items = array(
'id_user' => $temp_account->id_user,
'username' => $temp_account->username,
'logged_in' => true
);
$this->session->set_userdata($array_items);
redirect(site_url('account/view_success_page'));
} else {
//kalau ga ada diredirect lagi ke halaman login
$this->session->set_flashdata('notification', 'Peringatan : Username dan Password tidak cocok');
redirect(site_url('account'));
}
}
}
Message: count(): Parameter must be an array or an object that implements Countable Filename: controllers/account.php Line Number: 31
Method:
function check_user_account($username,$password) {
$this->db->select('*');
$this->db->from('user');
$this->db->where('username',$username);
$this->db->where('password',$password);
return $this->db->get();
}
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I created a password validation, but when I insert a new user, this validation is triggered after encrypting the password
I have python script in Splunk that generatesdocx report
I want to deny accedss to allphp files in "/xxxxx" directory