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

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…

Contents