Warning: This article/tutorial is more the 45 days old. As such the information contained within could be, by now, out of date. Please read all information to make sure that this article/tutorial will work with your current version of the Operating System
First let’s build a skeleton.
First, we will introduce the $password variable. Set this to anything you like. For the tutorial, we will use “phpmac”.
We will then display a password form if it has not already been submitted.
So now we have $password set and a form being displayed if it has not yet been submitted. Now, we will add an else to the conditional and inside that else and a second conditional that will compare the user’s input to $password.
Secret content!
And that’s it. If you would like, you may also display the password form again if it is incorrect. This is shown below:
Secret content!