Jump to content

Age verification


Recommended Posts

This is a very important thing for me because im building a shop for wine sales.

Where can i find the form for registration, and delete all birthdays from 1987-2008.

Maybe everyone can buy a Beaujolais in France?

Best Regards

Peder

Link to comment
Share on other sites

Thank Nerdygurl,

I doesnt have a clue after looking in validate.php either how to edit it!

Is it anyone who knows who i removes from the register list birthyears from 1987-2008 because they doesnt have the age for drinking and buying alcohol.

Best Regards

Peder

Link to comment
Share on other sites

  • 3 weeks later...
    /**
   * Check for birthDate validity
   *
   * @param string $date birthdate to validate
   * @return boolean Validity is ok or not
   */
   static public function isBirthDate($date)
   {
        if (empty($date))
            return true;
        if (preg_match('/^([0-9]{4})-((0?[1-9])|(1[0-2]))-((0?[1-9])|([1-2][0-9])|(3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $birthDate)) {
            if ($birthDate[1] >= date('Y') - 20)
                return false;
            return true;
        }
       return false;
   }



Do you see that 20 in line 12? It means that the birthyear has to be at last 1988.

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...