A Secret Page

Let's see how to create a secret page that would only be accessible to logged-in users.

Perks of logging in

Before we start building the login functionality, let’s give the user a good reason for logging in: a picture of the original elephpant from 2007. You can copy it from afieldguidetoelephpants.net (or you can download any other picture you like, of course). Here’s the code for public/secret.php, which should only be accessible to logged-in members:

Get hands-on with 1200+ tech skills courses.