PHP Tutorial: Professional Login System v2 (Part 2)
Uploader Comments (phpclass)
All Comments (25)
-
How do you find the database root?
-
Hi phpclass !
Thanx for these great tutorial ! Really appreciated.
Just on thing u may explain : why do set $this->id to 0 on the construct ?
I'm having trouble to pass the database validation with PDO.
Just trying to figure it out..;
Thanks in advance !
-
IT's so dificult to read. but i liked.
-
it showing this massage when i do anything i mean refresh, login, etc.
"Forbidden
You don't have permission to access /sid/< on this server."
what is this and why show this massage tell me phpclass
-
Im quite handy when it comes to PHP, but this object oriented side of it all just blows me away completely. The smallest thing has to be made super complex and annoying. Its a shame to be forced to learn it to be able to get work :(
Nevertheless, I respect you greatly for taking the time to do this and hope that people take the time to watch it again and again instead of bugging you endlessly.
-
great tutorial, however it is a bit hard to understand because you are using methods that you create afterwards. That can really throw people off.
Oh dude that preg_match from {5,12} is very unrealistic and was giving me an error on testing.
CamiloSanchez1979 2 years ago
Can you be a little more specific. Are you trying to create your own regular expression? Please provide the code that is giving you the problem.
phpclass 2 years ago
oh, no it's cool, I was just testing the form, but the preg_match section of {5,12} was giving me an error on the data I was entering, I didn't know why, as it turns out it was that piece of code, i am not that good on reg expressions. What i meant was that i think allowing people to put characters should go beyond 12..maybe like 40..but that's my opinion.
CamiloSanchez1979 2 years ago
Oh ok. Yea regular expression can be tricky at first, but once you get the hang of it then it will be a breeze. Well, if you have any questions or problems with these tutorials feel free to send me a message.
phpclass 2 years ago
hey phpclass friend..i am confused about
$this->error[] = $e getMessage();
Where in the script do we call the error msg?
can't $e just be echoed out without the array?
Thanks
CamiloSanchez1979 2 years ago
$e->getMessage() is part of the exception class. The error is called when we throw an exception:
throw new Exception("Put your error message in here");
And about your second question. Yes, you can output the $e error message right away, but in most cases it would be considered bad programming practice. Each method inside a class should have unique task. In this case, verify post is used only to verify post data. Therefore, I have a showErrors method to perform error output. And so on.
phpclass 2 years ago