From the course: PHP with MySQL Essential Training: 2 Build a CMS
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Authorized previewing
From the course: PHP with MySQL Essential Training: 2 Build a CMS
Authorized previewing
- [Instructor] In an earlier chapter, we created a feature that will allow admins to be able to preview content just as the public would see it but before the content was made visible to the public. And at the time, if you'll remember, we put a note in there that we wanted to come back to this topic once we understood user authentication so that we could actually make sure that the previewing was authorized by someone actually being logged in. Now that we understand user authentication, we can revisit that topic. The place where we added that preview code is in index.php inside the public directory. This is the main page for displaying content to the public. And you can see that we're checking here to see whether or not preview has been set, and whether it's been set to true, and if it has, then we're going to allow the user to preview the content. Let's take a look at that. Over here in my staff area, I'm going to find one of my pages that is set to be not visible. Going to view 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)
User authentication overview5m 11s
-
(Locked)
Create admins table3m 7s
-
(Locked)
Challenge: Build admin management3m 52s
-
(Locked)
Solution: Build admin management6m 30s
-
(Locked)
PHP password functions7m 27s
-
(Locked)
Authenticate user access8m 27s
-
(Locked)
Require authorization6m 15s
-
(Locked)
Log out a user2m 48s
-
(Locked)
Optional password updating6m 2s
-
(Locked)
Authorized previewing3m 46s
-
(Locked)
-
-