Check Age

Javascript coding ..

Moderators: gesf, Michalio

Post Reply
New php-forum User
New php-forum User
Posts: 1
Joined: Fri Feb 10, 2023 10:48 am

Good evening, I have a problem to solve.
I downloaded a script for verifying the age of access to a website from this address:
Let's create a jQuery Plugin that checks user's age when visiting your site. -Michael Soriano

I uploaded everything to the site and the popup for entering the age opened.
I put the link in the "redirect to" section in the script, but when I enter the date of birth as the age of majority, the popup disappears and the page below remains.
If, on the other hand, I enter the date of birth as a minor, the popup remains and there it stops with the message "Sorry you are not old enough to view this site".

I am attaching the zip file of the script, hoping someone can help me.
I state that I don't know how to program in php or javascript, I just found this script online, it seems interesting to me and I would like to use it.

Thank you.
(22.39 KiB) Downloaded 10 times
User avatar
Posts: 361
Joined: Sun Jul 18, 2021 1:33 pm
Location: Poland

Please share the github (or other website where the code is available) next time.
I pushed the code to github to browse the code much more simplier:

Let's check the code in work:

you need to pass the redirectTo and redirectOnFail properties to the script's settings:

Code: Select all

                    redirectTo: '/index.html?success',
                    redirectOnFail: '/index.html?fail',
Free coding lessons:
Post Reply