CodeIgniter Forums

Full Version: user login not work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I create user login,it work for when one user in the data base(one row),but when I add new users it is not working,what is the reson please help me.

Contrall class>>>>>>>>>>>
function validate_credentials(){

$query= $this->membership_model->validate();

'user_name' => $this->input->post('user_name'),





MOdel class>>>>>>>>>>>>

function validate(){



if ( $query->num_rows == 1){

return true;



echo 'khhhhhhhjkj';

this code work properly one user in the data base......

Thank you,

Hasitha Bandara Athauda............

El Forum

Your code seems ok. Are you using global xss. Could it be that the password cause the error? Maybe try with

This is not very secure since it leaves the field unprotected.
You should btw use something like
or any other encryption, so as not to store the real password in the db and also sanitize through enryption the data.

PS. please use the code tag to place code. [ code] [ /code] without the trailing space after [

El Forum

If your database passwords are hashed then you need to also hash the user's entered password to compare it to the database password!