CodeIgniter 2 + Sparks + PHP ActiveRecord Part 3: Login
Loading...
792
views
Loading...
Uploader Comments (ShawnMcCool)
see all
All Comments (7)
-
@ShawnMcCool That's good to know, thanks!
-
Thanks for the great tips. You're very fast at explaining everything; but atleast you don't go over the obvious things 50 times as if the people watching are idiots like some people do! Looking forward to some more videos in the future.
Loading...
ShawnMcCool, I seem to be getting PHP error when implementing this, a fault of the 404_override feature in CodeIgniter. When I go to something like mysite.com/welcome/doesnotexist, if the welcome controller does exist, and the doesnotexist method does not exist, the desired 404 page doesn't show up, and instead nasty PHP errors are outputted. Have you experienced this problem and what would be the best way to fix it? Also, why do you use the 'var' keyword? Isn't that depreciated in PHP5?
skcin7 2 weeks ago
@skcin7 Yea, I'm not using the var keyword anymore. Instead just using public, protected, or private. Despite the fact that it's not going to break anything, it just feels more like real programming. Check the CI manual for the 404 override information and/or post your errors. It's best to post them on my blog since I rarely check my youtube videos.
ShawnMcCool 2 weeks ago
Nice tutorial, one question though why don't you return the current user on successful login instead of just the id? That way you can save that extra query when you store the user data on the session.
vengiss 2 months ago in playlist More videos from ShawnMcCool
@vengiss It's generally not a good idea to store an AR object in sessions. Not only is there a limit to the amount of session data that could be stored but objects can lose some more advanced properties when serialized in a manner such as this. Not to mention that an admin may want to alter the user record.
Either way, there's really little to no value in saving that extra query as its result is typically cached.
ShawnMcCool 2 months ago
@vengiss It's not advisable to store complex data-types in this manner. It's fine if you just have a simple array or object. But, if you want to use references to other objects or anything like that then it can cause problems.
ShawnMcCool 2 weeks ago