From the course: PHP: Object-Oriented Programming with Databases
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Verify password - PHP Tutorial
From the course: PHP: Object-Oriented Programming with Databases
Verify password
[Instructor] We learned how to create new admins in our database and how to hash their password while we were creating them. We also learned in the last movie with validations how to look up a user by their username. So we're ready to start the process of building a login form. The idea is that the user would submit their username and password, will find that user by the username, and then verify that the password is correct. The way that we verify passwords are correct is with a handy peach p function called password underscore verify, and it makes it really simple because we just pass in the new password that's being tried, and match it with the hashed or encrypted password that's stored in the database. And php will handle all the work behind the scenes to see if they match or not, and it will return a boolean: true or false. Now it doesn't actually decrypt the hashed password during this process. What it does is it…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Admin class7m 40s
-
Hashing passwords7m
-
(Locked)
Admin validations7m 16s
-
(Locked)
Find by username5m 55s
-
(Locked)
Verify password5m 5s
-
(Locked)
Define a session class8m 34s
-
(Locked)
Add page access control4m 52s
-
(Locked)
Improve the session class7m 39s
-
(Locked)
Session messages6m 40s
-
(Locked)
-
-