Simple PHP Password Protect Script
Article Index - Simple PHP Password Protect Script
Author: Steve Dawson
Download PHP Password Protect Script
Creating a Password protected page on your website.
Do you want to have a hidden page on your website which only people who you give the password to can access it? Most probably you do as we all have something that we want to hide from prying eyes, that is were this PHP password protect page will come in useful
Surprisingly, there are still quite a few hosts that do not allow you to use .htaccess and .htpasswd files to create password protected areas on your website. To overcome this, we can use basic PHP to protect a page and keep our content hidden.
The beauty of this script is that it can be included into any page design and be used to protect just certain areas of a webpage or a full page.
The Simple Password Protect script is written in PHP and will run on any server which supports this. You do not need to use a database, just the simple PHP code which is included in the zip file.
Quick installation
- Download Simple PHP Password Protect Script
- Edit the index.php file and change the password to suit,
- Add the content you want to have protected in the correct section which is fully marked.
- Upload the file to your web server and then point your browser to the uploaded file and try it out.
In Depth Installation
Installation of Simple Password Protect is very straightforward and you just need to download the zip file and upload and/or rename the index.php file and add your content in the correct section of the file.
If you open the index.php file in a web editor you will see that there is a section where you can change the password which gives access to the protected area. Change this to what ever you want and pass this to the people whom you want to grant access to.

Adding the content you want protected
Again, inside the index.php page you will see a section about half way down where you can add the content which you want protected. This could be anything such as, links, contact information, pricelists for customers, family photographs etc. In fact it can be used for virtually anything you want to hide.

One thing to remember is that; do not use any sensitive information such as, credit card information, bank details or very personal details in any protected area. In fact I would go so far to say do not store any sensitive information on any webpage or website which is online. The reason for this is when a surfer sees a password box, it automatically triggers a small switch in the mind that something really good must be protected behind the password box, from this they will try and enter a few common passwords top see if they can gain entry, so always use a mixture so numbers and letters for your passwords.
Demonstration:
Take the password protect script for a test drive using the login password of 'admin'. This will let you see how the password protects page script works.
After reading through this article and downloading the script, you should be able to add a password protected section to your website. Any problems with this script or any other, please feel free to use the forums for assistance.
Regards, Steve
Can't find what you are looking for?
Please feel free to contact me for a free website quotation, ask a question in our web design forum, or to send us your requirements.
As a Freelance Custom Website Designer I can offer your business the opportunity to go on-line through my high quality custom website design service. If you are in any doubt or would like to discuss any of our custom website packages that we offer or would like further information on how we can help increase your current website's performance, please contact me for a chat about how I can assist.
Custom Website Design | Ecommerce Website Design | Business Website Design | HTML Email Newsletter Design | Search Engine Optimisation
Website Redesign | Database Website Design | Custom PHP Programming | Services Overview | Free PHP Scripts | Articles | Contact Info

UK Freelance Custom Website Design Company |