![]() |
password and username verification - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: password and username verification (/showthread.php?tid=47998) |
password and username verification - El Forum - 12-31-2011 [eluser]terry101[/eluser] I created a username/password check before and it worked fine for my login. I was trying to add a session with what i had before but i realized that now my password and username verification isnt work where it returns false. I don’t see any difference in what i had before, not sure where i could have messed it up. I dont get any errors but when i type in a valid username/password (already stored in database) it gives me Code: echo 'Username or password is invalid, try again'; i tried Code: $this->output->enable_profiler(1); Controller Code: function login() { Model Code: function check_login ($username, $password) { password and username verification - El Forum - 01-25-2012 [eluser]jjDeveloper[/eluser] Looks like your session_start is using an undefined variable. Try setting your variables to the global scope of the class using. Code: $this->username = 'username'; or pass the variable to the function. I don't know that this will fix your issue because I am limited as to what I can see from your code but it is one problem I noticed. password and username verification - El Forum - 01-25-2012 [eluser]JoostV[/eluser] Could it be that you have more than one user with that usename/password combination in your db? If so, your model's check_login() will return false. On a side note, you may want to run your username through xss filter. Code: $username = $this->input->post('username', TRUE); password and username verification - El Forum - 01-25-2012 [eluser]InsiteFX[/eluser] Also you should autoload the session library for something like that! And you do not need to use session_start... Your problem is in the get_where you can not pass an associated array to it with two parameters! Something like this! Code: // -------------------------------------------------------------------- |