description

With this PHP/MySQL-based Password Protect Content script you can protect any type of content: text, images, videos.

MySQL database is used to store all the content that you need to protect. For each block of content, you set a password. When visitors open the web page they will see a password box where such a protected content is placed. Upon entering the password, content will be displayed. It's a quick and easy way to protect small parts of your web page content!

Try our demo and see how it works! To see the protected content,
enter "pass12" in the first password box, and "pass123" in the second.

download

To download Password Protect Content for FREE you need to login your account.

how to install

Follow the steps below to install this FREE Password Protect Content script:

1) Download and unzip the script package.

2) Upload the Password Protect Content script files into a folder on your server.

3) Edit config.php file and MySQL login details:

$SETTINGS["hostname"]='localhost';
$SETTINGS["mysql_user"]='';
$SETTINGS["mysql_pass"]='';
$SETTINGS["mysql_database"]='';
$SETTINGS["data_table"]='member';

4) Open database.sql and import all MySQL queries into your database. MySQL table will be created where protected content will be stored. There are 2 sample records.

5) Open the example web page example-page.html using any web browser and you should see 2 password boxes for 2 password protected texts. You can change the passwords in the MySQL table. You can add as many content sections as you want. Each will have a unique ID which needs to be used in the JS code that you will put on your web page.

<script language="javascript" src="load-content.php?id=1"></script>

So, if you create a new content (add actual content and password that will unlock it), it will be added with a unique ID. Then use this ID in the JavaScript code. Put that code on your web page where you want the protected content to appear.
3 Comments to "Password Protect Content"
  • jack

    jack

    May 28, 2017 at 23:53 pm

    Hi is it possible to support cross domain to make this script better or is it not possible with this kind of script.

    thanks

Add your comment

Captcha