Example Installs

Child Only Website

Lets assume that I have a website about unicorns called www.demounicornwebsite.com and that I only want children to have access to the bulk of this site.

Before installing AgeLock my file structure is:

  • index.php – The main or home page
  • aboutus.php – with contact info to email me about unicorn
  • unicorn_facts.php – a page with my unicorn facts
  • famous_unicorns/ – a folder
    • emilia.php – a  page about a unicorn
    • isla.php – a  page about a unicorn
    • mia.php – a page about a unicorn

Copy the agelock folder to the root directory, the same location as index.php, my structure now looks like this:

  • index.php – The main or home page
  • aboutus.php – with contact info to email me about unicorn
  • unicorn_facts.php – a page with my unicorn facts
  • famous_unicorns/ – a folder
    • emilia.php – a  page about a unicorn
    • isla.php – a  page about a unicorn
    • mia.php – a page about a unicorn
  • agelock / – the agelock folder
    • agelock.php – the main AgeLock file which hold all the settings
    • index.php – a small file used for redirecting to the correct template
    • themes / – a folder containing the default themes/templates
      • light.php – a default template
      • dark.php – a default template
      • index.php – another template file
      • custom.php – a barebones template for you to customise if you wish
    • assets / – folder that contains the javascript and css to enable styling and responsive design

Now to configure AgeLock. Open up agelock.php from within the agelock folder using a text editor, find and update the following settings found within the top/first half of the file.

minimum_age_in_years = null;
maximum_age_in_years = 13;
installed_folder     = 'http://www.demounicornwebsite.com/agelock/';
title     = "Welcome to Demo Unicorn Website";
subtitle = "You must be under 13 to view this site";
description = “Click Yes if you are not yet 13 years old”
simple_check = true;
success_page = 'http://www.demounicornwebsite.com/unicorn_facts.php';

Next step is to enable the AgeLock system on the pages that you wish to protect.
I have decided to protect the unicorn_facts.php page and all the pages within my famous_unicorns folder with the following php code to the very top of the files :

<?php include 'http://www.demounicornwebsite.com/agelock/agelock.php'; ?>

Done!

If a user tries to go to the mia.php file about the ‘famous unicorn’ Mia they will be redirect to a page that looks like this.unicorn

Adult Only Website

Lets assume that I have a website about an alcoholic drink called www.demodrinksite.com and that I only want people 18 and over to be allowed in.

Before installing AgeLock my file structure is;

  • index.php – The main or home page
  • restricted / – a folder with all the files / pages that I wish to protect with AgeLock

I copy the agelock folder to the root directory, the same location as index.php my structure now looks like this:

  • index.php – The main or home page
  • restricted / – a folder with all the files / pages that I wish to protect with AgeLock
  • agelock / – the agelock folder
    • agelock.php – the main AgeLock file which hold all the settings
    • index.php – a small file used for redirecting to the correct template
    • themes / – a folder containing the default templates
      • light.php – a default template
      • dark.php – a default template
      • index.php – another template file
      • custom.php – a barebones template for you to customise if you wish
    • assets / – folder that contains the javascript and css to enable styling and responsive design

Now to configure the AgeLock script. Open up agelock.php from within the agelock folder using a text editor and update the following settings:

 minimum_age_in_years = 18;
maximum_age_in_years = null;
installed_folder = 'http://www.demodrinksite.com/agelock/';
title = "Welcome to Demo Drink Site";
subtitle = "You must be an adult to enter this site";
simple_check = false;
dmy_oder = 'dMy';
dmy_heading = "Please enter your date of birth";
t_and_c = “All purchases made on this web site are governed by these Terms and Conditions at any time although the Terms and Conditions governing any given purchase will be those in effect at the date of your order. If you order goods after
we have published any changes you will be bound by those changes. Accordingly, you should check prior to each order make sure that you understand the precise terms and applicable to your purchase...”;
t_and_c_heading = = “<h4>Terms and Conditions</h4>”;
success_page theme = 'http://www.demodrinksite.com/restricted/index.php';
theme = “dark”;

Next step is to enable the AgeLock system on the pages that you wish to protect.

I have decided to protect all the pages within the restricted folder, so to all these pages I’ll add the following code to the very top of the files :

<?php include 'http://www.demodrinksite.com/agelock/agelock.php'; ?>

Done!

If a user tries to go to any page within the restricted section of the site they will see a screen like this:

drink

Was this article helpful to you? Yes 1 No 1

How can we help?