Request: Age Verification

Permalink 1 user found helpful
I have a request for a addon.

Some site's in the EU need age verification.
No, not only porn but manufactures of booze etc.
So my request is to make a addon for this.

Who can help me out?

Currently i'me working on a website for a wine importer and he needs age verification for his website.
I tried several things to make an age verification script.
But all did fail...

So what i need is like a page or a subdomain with an form that ask the question: Are you over 18 years old?
With the answers Yes and No. Just plain and easy.

So when they visit the website (, there will be a check if there's a cookie and if the awnswer to the question is yes.

If the cookie isn't there then it needs to go to ( where the form is situated.
If they click on yes the cookie is set and they could watch the site without redirecting to for like a day.
If the click no they should go to like
or a page wich make the cookie unavaileble for a day or to.

o yeah i forgot one little problem. there must also be an little script i think so that they couldn't sneak in. So when the type they still go to the verify page.

so this is the whole problem.

Who can help me out?

View Replies:
Remo replied on at Permalink Reply
bryanlewis replied on at Permalink Reply
Not a bad idea for a block. I could see this being useful for winery's and whatnot.
Frisbeeld replied on at Permalink Reply
Sorry i Will delete the other post:)
thephilm replied on at Permalink Reply
I've seen age verification on sites like:

1. Were you wanting a "splash" page before entering the site only. Would deep linked bookmarks require age verification and redirect?

2. Would they need to be age verified for any page of the site, or would there be some parts of the site they wouldn't require it?

I'm thinking that a modified user registration system could work, that would utilize the existing backend, but could be over-doing it! (and over-complicating)

You may be able to do a splash page, and have a cookie stored, then modify the header _required to only display if the cookie is set, if not - display the age verification (or redirect to the home/splash page).

Frisbeeld replied on at Permalink Reply
well if its possible i would like to make a subdomain ( where they kan choose between 2 options yes and no that simple.

When they say yes, they go to the website ( If no go to
and here he needs to remember the cookie that is set so it won't redirect again. Bad idea?

The whole site needs to bee blocked if the person is younger. And that he can't see it for like a day or so.

so i think i need just a little script in the header_required to check if the cookie is there. if not send him to the verification. when the cookie is there
they can see the whole site.

Hope you can help me with this. And hope i gave an answer to your questions.

Fernandos replied on at Permalink Reply
You could easily add both display option into one package by providing templates.
Fernandos replied on at Permalink Reply
hmm you could write a passport id verification script also, that would be more reliable and wouldn't need a third party validation service.
Frisbeeld replied on at Permalink Reply
would be nice but it's not where i'me looking for;)

but great input.
thephilm replied on at Permalink Reply
Can it be a simple yes / no, or would you require a date to be entered?
Frisbeeld replied on at Permalink Reply
Yes, it only has to be an simple yes no. At least that's what the king wants so... thats what he'll get.

Have a look at this, well its flash but it works. And they haven't got any complains yet of some authoritaaah (srry southpark just popped up in my head).
ideasponge replied on at Permalink Reply
why does it need to go to a subdomain? I am not sure the gains from that exceed the losses. Meaning it would probably be best to just keep everything on the main domain.

Here is a possible non-new-block solution; Have something in your Theme files that checks for the cookie. If no cookie found then redirect to
On that page you have a content block for text and 2 images, one for yes and one for no. The Yes image links to On that page you have a PHP block with code that writes the cookie and redirects to

I do agree an age verification block would be cool but if not having one holds you back, this could work.
Fernandos replied on at Permalink Reply
I mean this leads all to the ethical question, control or trust.

1. But if you trust your users you can't be sure that they give you their real age.

2. On the other hand, it doesn't make any sense to force guests to verify their age if this isn't really crucial for this special business.
So in this case only it would make sense to write a PIV (Passport Identity Validation) script and calculate the guest's age from there.

For the perfectionists:
"There's no concrete way to absolutely proof someone's age except manually checking the passport and manually comparing the passport photo's biometric data with the actual person."

For those who still don't believe:
"I know how you could achieve this automatically by writing an app that checks the biometric data of your face and compares that with the photo on your passport and also reads the passport's birth date with ocr then validates it."

Still it's all not really reliable.
An you've to admit that technically it's not possible to approve someones age 100% but the Passport Identity Validation is quite good. All other mechanisms like dropdowns with dd/mm/yyy fail and degrade the user experience.

The conclusion:
A boolean question that would ask if you're old enough or not in form of two (large) buttons would be truly enough.

That's why I would recommend a "Primary & Secondary action" uipattern.

It's also not seo wise to create a real page to page redirection. You should better rely on a jquery solution in my opinion.

PS: I might create this PIV block after my exams.
ideasponge replied on at Permalink Reply
lol Fernandos brilliant suggestion but I think a bit overkill for this purpose. An age check script isn't really meant to verify the age, but is to cover the website owner legally.
agedman replied on at Permalink Reply
I see your point about SEO. But if jQuery was used for the redirection, what would happen if Javascript was disabled in the browser?
Frisbeeld replied on at Permalink Reply
Thanx for the advice.
honestly the idea of having it on an other subdomain seems just cool =P. And i thougt this would make it a bit safer. But also a bit more difficult. This would be an option.
Frisbeeld replied on at Permalink Reply
I still have some issue's with the ageverification. I made an single page "ageverification" and here i got the form with the two buttons yes and no.

here's the simple code for the page:
<form action="/ageCheck.php" method="post">
<h1>Ben je ouder dan <span style="color:#990000;">18</span> jaar?</h1>
<input class="ja" name="valid_age" type="submit" value="Ja" />
<input class="nee" name="invalid_age" type="submit" value="Nee"/>
<p>   De producten van het merk DOUBLE U WINES zijn alcoholische dranken en dienen, op eigen
<br />
verantwoordelijkheid, alleen te worden geconsumeerd door volwassenen.
<br /><br />
Als je jonger bent dan 18, klik dan op NEE om deze website te verlaten.
<br />
Door op JA te klikken bevestig je ouder te zijn dan 18 jaar en kun je de website bezoeken.<br /><br />
Ministerie van volksgezondheid: <span class="size">Overmatig alcoholgebruik kan schadelijke gevolgen hebben!</span></p>

so this is the form.
i also added an single page ageCheck. This is the code:
//Start session
 * First, we want to make sure they came to this ageCheck.php via a form.
 * Then we can check to see if $_POST['valid_age'] is set, since it will only
 * be set if they pressed the "I'm 21" button.
       * Since they got here, it means they are of the right age.
       * Now we set the session value.
      $value ="Ja";

so the action of the form should go to the ageCheck page and check if it's all correct.

So i made some changes to the header_required as phil said to me.
//Start the session
 * If they haven't passed the age test
 * then the age_verified session will not
 * be set, since it is only set if they
 * say they are 21 years of age.
if( !isset($_COOKIE['age_verified'])){
defined('C5_EXECUTE') or die(_("Access Denied."));

tested the script and well got a black page...
what am i doing wrong?
agedman replied on at Permalink Reply
Hi, the code tags in your last post muddled up the header() function call by wrapping your url in an anchor, but I think there is be something wrong with your verification page.

When I type in my browser, I get a 500 Internal Server Error.

Looking more closely at the code you posted for that ageverification page, you have your markup wrapped in php tags. I think you should just remove those tags and the server will be able to show your form (ideally you would also add some other tags around your markup <html><head></head><body>... </body></html>) -- either that or include the standard header and footer.
Mnkras replied on at Permalink Reply
1. the syntax thing on the forums is crappy and adds the php tags
2. don't use <center> use the css rule align:center as the tag will be deprecated

Fernandos replied on at Permalink Reply
there is no css rule align:center :P
though there are several articles explaining howto center elements horizontally, vertically or both.

margin:0 auto; is the cheapest and easiest way of centering an element via css.
Frisbeeld replied on at Permalink Reply
Frisbeeld replied on at Permalink Reply
seems like this discussion isn't going any far. If someone knows a sollution to the problem. please send a private message.

Getting a bit crazy of my script...
Fernandos replied on at Permalink Reply
Dude that's basic php, really simple.
You can check this if you have some time:

btw: I gotta learn for two exams that I've tomorrow :(
Frisbeeld replied on at Permalink Reply
feeling sorry for you have to learn for your exams. The best of "Luck" wel wisdom should be a better word for this.

But tried this script all ready doesn't work.
ScottC replied on at Permalink Reply
in 3 minutes, here's exactly what you need to do, in a concrete5 way that will work.

1. create a block, this block has a form that creates a modal popup using lightbox or facebox or whatever you want.

in the block's view method, you fire off the form unless a check to $_SESSION['isOver18or21'] = 1, the easiest way is to put this switch into the on_start using something like:

$isOver = $_SESSION['isOver18or21'];

if($isOver > 0) return;
$this->addHeaderItem($html->js('popup_maker.js','age_verification'); //js and package name

then in your block's form you create the action_form_verify_age(){
if($this->verifyPostDate($this->post('age')) $_SESSION['isOver18or21'] = 1;
//bad kid, bad!
$_SESSION['isOver18or21'] = 0;

so now you know if your user has stated their age.

Then you should explore using simply in your package on_start method

if($_SESSION['isOver18or21'] == 0){
$cont = new Controller();

just going off the top of my head, but you can probably figure it out from there.
ideasponge replied on at Permalink Reply
did you attempt my solution? Make sure you have ob_start() at the very top of any page that will have some redirect code in it. this really comes in handy since it keeps anything from being sent to the browser until all processing has been completed. It can be a bit more memory intensive since all output is buffered before sent, so only put it in a special Page Type you create just for this.
Frisbeeld replied on at Permalink Reply
I allready got a sollution to the problem. I wanna thank you guys for all of the help. It wasn't that hard after all.
FatTony1952 replied on at Permalink Reply
What was your solution?