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

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…

Contents