Peder Posted October 14, 2008 Share Posted October 14, 2008 Hi everyone,Is it possible to deny users under 20 year to register in the shop?Best RegardsPeder Link to comment Share on other sites More sharing options...
Peder Posted October 21, 2008 Author Share Posted October 21, 2008 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 RegardsPeder Link to comment Share on other sites More sharing options...
nerdygurl Posted October 21, 2008 Share Posted October 21, 2008 If you look in your Validate.Php under classes you can find the birthdate validation code in there how to change it ? I wouldn't have a clue sorry Link to comment Share on other sites More sharing options...
Peder Posted October 21, 2008 Author Share Posted October 21, 2008 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 RegardsPeder Link to comment Share on other sites More sharing options...
Bruz Posted November 8, 2008 Share Posted November 8, 2008 /** * 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 More sharing options...
Peder Posted November 9, 2008 Author Share Posted November 9, 2008 Hej Bruz,Thanks, i have tried to change that to 20 and its still when you register are year 1900-1998 under birthdate./Peder Link to comment Share on other sites More sharing options...
Bruz Posted November 9, 2008 Share Posted November 9, 2008 You're right, it's still there - but when you try to enter something prior to 1988 it gives you the "invalid date" error now Link to comment Share on other sites More sharing options...
Peder Posted November 9, 2008 Author Share Posted November 9, 2008 Thanks a lot Bruz, perfect!!!Best RegardsPeder Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now