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.
Solution: Preview content
From the course: PHP with MySQL Essential Training: 2 Build a CMS
Solution: Preview content
- [Instructor] In the last movie, I gave you a challenge assignment to implement the preview content feature in our application. That would allow a staff member to be able to preview content that's not yet visible to the public, but to preview it in the same way that the public would eventually see it. Hopefully, you did well with it. Now, let me show you the solution that I came up with. The first thing that I did was I went into the public directory, into staff, into pages, and found show.php. And on that page, I added a link. I went ahead and added a div called class actions and a link, which I gave a class of action. And the href for that is going to be for that index.php page, right? That's the homepage that we've been looking at. And I gave it a page ID that we want to look at. That's the current page ID that I'm working with in the staff area. I used good escaping techniques on that using URL, and code, and HTML special chars. So it's going to have both of those shortcuts…
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)
The public context5m 43s
-
(Locked)
Skip hidden subjects and pages3m 8s
-
(Locked)
Use an option for conditional code6m 34s
-
(Locked)
Insecure Direct Object Reference (IDOR)4m 20s
-
(Locked)
Protect page visibility6m 6s
-
(Locked)
Allow HTML in dynamic content6m 46s
-
(Locked)
Challenge: Preview content2m 11s
-
(Locked)
Solution: Preview content4m 12s
-
(Locked)
-
-
-
-