Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Date question
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

e3stone
Average Member

USA
885 Posts

Posted - 07 May 2001 :  18:57:45  Show Profile  Send e3stone an AOL message
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.

How do I fix this?

<-- Eric -->


http://insidewaco.com

e3stone
Average Member

USA
885 Posts

Posted - 07 May 2001 :  19:06:41  Show Profile  Send e3stone an AOL message
nevermind, I fixed it.

used: (datediff("d",birthday, now))/365.25

<-- Eric -->


http://insidewaco.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07