Nettuts Day 6- Login Issues |
[eluser]domoench[/eluser]
Hi All, I'm new to CodeIgniter, and I'm stuck in the middle of the Nettuts CodeIgniter Day 6 tutorial. At 30:10 I am no longer able to do what is shown. My login.php controller is as follows: Code: <?php I guess something in the body of validate_credentials()'s if statement is not working, because the else statement is always executed. I suspect that $this->membership_model->validate(); (membership_model.php shown below) is not returning true for the if statement. membership_model.php Code: class Membership_model extends CI_Model While trying to figure out the issue I've done the following: - Double-checked that my username and password in my database matched the language in the above membership_model.php - Autoloaded the session class, and put a string of 32 assorted characters into the $config['encryption_key'] within the config.php file. - Looked for syntactical typos Any suggestions as to what the problem might be? Am I handling the session class/encryption key correctly? Thanks! David
[eluser]InsiteFX[/eluser]
Try this: Code: class Membership_model extends CI_Model InsiteFX
[eluser]domoench[/eluser]
Thanks for catching that InsiteFX - I guess there's more to it though, after correcting that typo there's no change in behavior.
[eluser]InsiteFX[/eluser]
I' ll download it later and take a look at it! There is not enough code here to see what is really going on! InsiteFX
[eluser]domoench[/eluser]
I created a test view, and passed it the data from my 'membership' table (contains info about members that can log in: first_name, last_name, username, password), successfully outputting it to the screen. So I know I can connect to and pass around info from the database and table, and that they look like I expected them to. Could the problem involve the password encryption md5() function in membership_model.php? The tutorial video is demonstrated on CI 1.7, and I'm currently working with 2.0.1, and I already discovered one difference between the versions- In 2.0.1 autoloading the session class requires you set an encryption key. So something related to encryption is different now. I assigned a random 32 character string to the 'encryption_key' which allowed me to proceed with autoloading the session class- but perhaps I did something incorrectly there? |
Welcome Guest, Not a member yet? Register Sign In |