I'm trying to verify that the users are at least 16 years old. I have the following code in register.asp:
if (request.form("birthday_month") <> "") and (request.form("birthday_day") <> "") and (request.form("birthday_year") <> "") then birthday = request.form("birthday_month") & "/" & request.form("birthday_day") & "/" & request.form("birthday_year") age = datediff("yyyy",birthday, now) if age < 16 then Err_Msg = Err_Msg & "<li>You must be 16 or older to become a member</li>" end if end if
However, if I enter any birthday in the year 1985, it'll return that they're 16. if they were born 5/7/85 they would be 16, but if they were born 5/10/85 they would be 15, but this code says that either one is 16.