From the course: PHP: Object-Oriented Programming with Databases
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
Admin class - PHP Tutorial
From the course: PHP: Object-Oriented Programming with Databases
Admin class
- [Instructor] In this chapter, we will add user authentication to the staff area of our project. We discussed user authentication in the PHP with MySQL Essential Training course, so we won't revisit all of the fundamental concepts. However, we will learn to use object-oriented programming techniques instead of the procedural programming that we learned before. The first step is to create our admin class. To do that, we'll first need to create a database table to store our admins, so I'm going to call that admins and it's going to have a number of columns on it. Obviously, it will need an ID column for its primary key, but we'll also have first_name, last_name, email, username, and hashed_password as columns. The hashed_password will store an encrypted version of the password. Once we have database table defined, then we can define our admin class, being sure to inherit behavior from the DatabaseObject class so that we have all of the active record behavior we created in the last…
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)
-
-