Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
leadthepack

How can I add an age verification popup?

Question

I’m creating a website for a local brewery and need to figure out how to add an age verification request that pops up when visitors come to the site for the first time. Just needs to be basic and ask “Are you 21?” If “Yes,” let them into the site, if “No,” send somewhere else.

I searched and found a bunch of JavaScript options, but I can’t figure out how to implement it, since Squarespace 6 file modification & storage is limited.

Thanks in advance!

Edited by leadthepack
Tidy, fix tags

Share this post


Link to post

12 answers to this question

Recommended Posts

  • 0

I built a simple age-gate solution for Squarespace. It's available on my website here:

https://www.soundfocus.co.uk/squarespace/age-verification-pop-up

You can try it for free. There's a very small one-off charge to use it on your site. If you need a more advanced or customised solution, we can build these too.

-Paul

Squarespace Expert & Professional Developer


If anyone's response has helped you, click the like-20-mag.png.3997345d620e40b4760b5d7a667cad54.png icon (bottom-right) to show them some appreciation. If their response didn't help, ask for more help, or wait for users to chime in. 
Need more help than I can provide via the forum? I'm a professional Developer who works with Designers internationally. You can book me via my company's website.

Share this post


Link to post
  • 0

Perhaps you might want to check out IDology's, ExpectID Age product that will help keep compliance while quickly confirming someones age accurately.

On the other hand the code below will do the most basic aspect if put on the main landing pages.


<?php
session_start();
if ($_REQUEST["over21"] == 1) {
   $_SESSION["over21"] = 1;

   header("Location: " . $_REQUEST["redirect"]);
}
?>
<html>
   <head>
       <title>Verify Your Age</title>
   </head>
   <body>
       <a href="verify.php?over18=1&
redirect=<?=$redirect?>">I am over 21</a> | 
       <a href="http://www.google.com/">I am not over 21</a>
   </body>
</html>

Edited by raptor2skooled

Share this post


Link to post
  • 0

I just faced this problem myself (although I needed a verification page, not a pop-up). I couldn't find a solution that satisfied my requirements. I now this post is more than 6 months old, buy I'm leaving my answer in case anyone else needs it.

You can get my code at https://github.com/cotupha/octli

It has the javascript necessary, as well as other files that serve as example demonstraiting how to use the javascript. It is explained how to do it without activating developer mode (which was a requirement of my client).

Share this post


Link to post
  • 0

@cotupha thank for sharing, I'm having difficulties implementing your code on squarespace platform, is it possible for you to explain the steps in to implement. Any help greatly appreciated!

Share this post


Link to post
  • 0

@cotupha (or anyone else) Would you be able to help me get this set up? I'm a bit confused on a couple of the steps. I'd be willing to pay you for your time.

Share this post


Link to post
  • 0

"... It is explained how to do it without activating developer mode (which was a requirement of my client)..."

For those confused, it took me a minute of confusion as well, but according to Cotupha's instructions you would still have to set up the age verification code outside of squarespace. The first two steps wouldn't be possible with squarespace hosting as-is (non developer mode).

As it stands – I don't see any solution on the boards for an age verification that isn't just a cover page.

Edited by ryanthompson

Share this post


Link to post
  • 0

Pertho Engineers is a growing 3KVA, 5KVA, 7KVA, 10KVA, 20KVA online ups services like repair and maintenance company in Delhi NCR, Noida, Faridabad, Ghaziabad. call at 9873100565. We at Pertho Engineers also deals in all types of Online UPS and Power supply services like Stabilizer, Line Interactive Services, Online single phase and three phase UPS etc. We provide these Stabilizer, Line Interactive Services, Online single phase and three phase UPS services at lowest price ever. For details Click here for details. http://powersupplynservices.com/services/5kva-online-ups-repair-company-delhi-ncr/


Pertho Engineers is a growing 3KVA, 5KVA, 7KVA, 10KVA, 20KVA online ups services like repair and maintenance company in Delhi NCR, Noida, Faridabad, Ghaziabad. call at 9873100565. We at Pertho Engineers also deals in all types of Online UPS and Power supply services like Stabilizer, Line Interactive Services, Online single phase and three phase UPS etc. We provide these Stabilizer, Line Interactive Services, Online single phase and three phase UPS services at lowest price ever. For details Click here for details. http://powersupplynservices.com/services/5kva-online-ups-repair-company-delhi-ncr/

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...