Hi, downloaded src code from ur site, setted up db and everything, registration isn't working. Says An error occurred. Please try again. Other things like resetting password, login for manually added user working correctly. DB Log is empty too
Hey i just downloaded the files, and everything is working, registration to. As for the log file check the files permissions. If i think of something on what goes wrong on your side, i will get back to you.
It worked for me after writing 'root' in the definition for USERNAME in config.php but I'm a complete beginner so you'll probably know more about this than me :)
Hey, in most cases when we typing along we make typos. Did you check for any typing errors in the login function? Compare your loginUser function with the one on this page digitalfox-tutorials.com/tutorial.php?title=Coding-a-secure-login-system-with-php-and-mysql
I think you have security problem with the "forgot password" function. It asks for an email address then only checks that the address exists in the database. If a user has an account (or just creates one) they can break into any other account that they know the user name for. They just say "forgot password" on it, then enter their own email address and get a password for the other account. I think what it should do is ask for the user name , then send the changed pw to the email on file for that user. Just checking the email exists is too weak.
Gaining access to another account by updating your password and use it with a username that you already know, is not possible. You can try it out, i have a live demo on my website. digitalfox-tutorials.com/tutorial.php?title=Coding-a-secure-login-system-with-php-and-mysql
"Hello sir, I'm a junior web developer and I'm working on a project that requires a login and registration system. I'm a bit confused about a piece of code I've come across. What would happen if I use the following PHP code for registration? // Class definition class Register { public function register($username) { // Codes to handle username with session } } // Create object $register = new Register(); // Method call echo $register->register($username); Would this kind of code structure work if it was made good or is it better to use this kind of structure. Thank you so much .
Yes, you can use OOP to create a registration system. I prefer to create code using objects, it's easier to maintain and it's easier to move your classes from a project to another.
what a nice tutorial to watch. Thanks for making this!
Thank you! Cheers!
This will help in my Final Year Project !! Thanks ❤
Perfect!
Appreciate your work!
Thank you
Thank you, this tutorial was very concise and well explained.
You're welcome!
This explained well!
Thank you Haley
Hi, downloaded src code from ur site, setted up db and everything, registration isn't working. Says An error occurred. Please try again. Other things like resetting password, login for manually added user working correctly. DB Log is empty too
Hey i just downloaded the files, and everything is working, registration to. As for the log file check the files permissions.
If i think of something on what goes wrong on your side, i will get back to you.
It worked for me after writing 'root' in the definition for USERNAME in config.php but I'm a complete beginner so you'll probably know more about this than me :)
@@rosawolke2788 thank you so much!!!
This is very valuable content, bro. Thank you.
Thank you
Hey George! I follow along with your tutorial, but I am not able to login even if I input a valid credentials on it.
Hey, in most cases when we typing along we make typos. Did you check for any typing errors in the login function?
Compare your loginUser function with the one on this page digitalfox-tutorials.com/tutorial.php?title=Coding-a-secure-login-system-with-php-and-mysql
Thank you, this was well explained & helpful :)
Thank you too
I think you have security problem with the "forgot password" function. It asks for an email address then only checks that the address exists in the database. If a user has an account (or just creates one) they can break into any other account that they know the user name for. They just say "forgot password" on it, then enter their own email address and get a password for the other account.
I think what it should do is ask for the user name , then send the changed pw to the email on file for that user. Just checking the email exists is too weak.
Gaining access to another account by updating your password and use it with a username
that you already know, is not possible.
You can try it out, i have a live demo on my website.
digitalfox-tutorials.com/tutorial.php?title=Coding-a-secure-login-system-with-php-and-mysql
"FILTER_SANITIZE_STRING" seems to be deprecated in PHP 8.1
Yes i know, we have to use htmlspecialchars() instead.
"Hello sir, I'm a junior web developer and I'm working on a project that requires a login and registration system. I'm a bit confused about a piece of code I've come across. What would happen if I use the following PHP code for registration?
// Class definition
class Register {
public function register($username) {
// Codes to handle username with session
}
}
// Create object
$register = new Register();
// Method call
echo $register->register($username);
Would this kind of code structure work if it was made good or is it better to use this kind of structure.
Thank you so much .
Yes, you can use OOP to create a registration system. I prefer to create code using objects, it's easier to maintain and it's easier to move your classes from a project to another.
Why you dont close the php tag?
If you have a php file and you are writing only php, you don't have to.
@@DigitalFox-tutorials and it is more efficient because you are not constantly stopping and starting the interpretor
"if($password != $dbpass) {" you are using loose comparisons which might be still somehow vulnerable
Hey, where did you get this line of code? I use the password_verify function to check the password that is stored in the database.