![]() |
Fatal Error,Loopy code - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Fatal Error,Loopy code (/showthread.php?tid=5265) |
Fatal Error,Loopy code - El Forum - 01-14-2008 [eluser]Peterk[/eluser] Code: if(isset($this->validation->login_email)) being called here: Code: <?=form_input($login_email,$valid_login_email)?></label></p><br /> // line 43 I know it's not "clean code" but I needed to do it the old fashioned way so I could follow the logic. It produces the error below, and I have no idea why. Any help? Fatal error: Call to a member function decode() on a non-object in /codeigniter/system/application/views/forms/login_form.php on line 13 Fatal Error,Loopy code - El Forum - 01-14-2008 [eluser]Craig A Rodway[/eluser] Have you loaded the encryption library? Fatal Error,Loopy code - El Forum - 01-14-2008 [eluser]Peterk[/eluser] Yes, I loaded it. Fatal Error,Loopy code - El Forum - 01-14-2008 [eluser]Peterk[/eluser] basically what's happening is that I set a cookie with the pass/login encrypted. Then when the user clicks the "remember me" checkbox I use get_cookie('whatever') to grab that pass/login from the cookie. Now what happens is that when the cookie is encrypted, it returns the encrypted values of "whatever_df84545345" , so that's what shows up in the text fields for pass/login. When I decode the information in the cookie via: $this->encrypt->decode(get_cookie('whatever')); it looks right in the pass/login text fields and works fine for established users. Now when a NEW USER tries to sign up for the site, I get: Fatal error: Call to a member function decode() on a non-object in codeigniter/system/application/views/forms/login_form.php on line 13 for whatever line I have this on: $this->encrypt->decode(get_cookie('whatever')); Fatal Error,Loopy code - El Forum - 01-14-2008 [eluser]Craig A Rodway[/eluser] Try to see if the cookie has a value first, before you try to decode it. Fatal Error,Loopy code - El Forum - 01-14-2008 [eluser]Peterk[/eluser] I'm going to leave this here in case someone runs into the same problem. I needed to load the encrypt library in my new user registration class. Since the code for existing users goes down one path, and the code for new users goes down another, you need to load the encrypt library in both classes. I only had it loaded in my existing users code path. Thanks for the heads up Craig. Much appreciated. |