Login System, help? - 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: Login System, help? (/showthread.php?tid=26777) |
Login System, help? - El Forum - 01-22-2010 [eluser]Declan[/eluser] Hello CI forums, I've been looking at a lot into codeigniter lately and recently decided to build something with it. I started with the login system, and I'm having trouble. Here's my code: Login Controller: Code: <? Login Model: Code: <? Login View: Code: <? My problem is that when I click login it takes me to "login/validate_login", but gives me a 404. All help is greatly appreciated. :cheese: Thanks, Declan. Login System, help? - El Forum - 01-22-2010 [eluser]danmontgomery[/eluser] Code: $this->load-model('membership_model'); Fixed this and your code works fine for me... Do you have some routing defined? Login System, help? - El Forum - 01-22-2010 [eluser]Declan[/eluser] Thanks for the quick reply, I fixed that.. But I'm still getting the 404. I'm not sure what you mean by do I have some routing defined. Code: $route['default_controller'] = "navigate"; That's for navigating through my template. I don't think that's the problem though because that works now and before I started the login system. Login System, help? - El Forum - 01-22-2010 [eluser]Declan[/eluser] I searched "404" on my userguide and found: Code: "Modified method calling to controllers to show a 404 when a private or protected method is accessed via a URL" This might be the problem? Login System, help? - El Forum - 01-23-2010 [eluser]stef25[/eluser] What you saw in the userguide should not be the issue since the validate_login() method should not be protected or private (that would happen if you start the function name with an _underscore) If you put a die('here'); as the first statement in your validate_login() and then visit your site.com/validate_login - do you still see the 404 (not sure if you removed index.php)? Login System, help? - El Forum - 01-23-2010 [eluser]Declan[/eluser] I changed the validate_login() function to look like this: Code: function validate_login() But still get a 404, I'm boggled. Login System, help? - El Forum - 01-23-2010 [eluser]stef25[/eluser] This means you are not even reaching this function. What do your routing and htaccess files look like? Login System, help? - El Forum - 01-23-2010 [eluser]Declan[/eluser] Okay, I fixed some things and now with the die('here') added it dies. Also, I'm using a sort of template system to navigate my site which might be affecting things? I have one main view that loads other views inside of it, so the links on my website are 'game/tos' ect. Code: <?php Login System, help? - El Forum - 01-23-2010 [eluser]Declan[/eluser] The problem was to do with my config, I had it so it was 'http://localhost/game/application', once I removed the application it worked... Sorry for the waste of time here, I'll read up more on everything before I post any problems again. |