Current location: Hot Scripts Forums » Programming Languages » PHP » Calculating age for registeration


Calculating age for registeration

Reply
  #1 (permalink)  
Old 09-15-09, 01:31 PM
billa1 billa1 is offline
New Member
 
Join Date: Sep 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Calculating age for registeration

what is best approach to calculate age to allow/disallow registeration? For example if want to allow the persons above 18 years to register, how should i calculate the age? I saw some example on google where they convert days first and then make it to years, but i think it does not give the exact age? it gives only round about? Is there any good way to calculate the age ? Any example would be appreciated.
thanks
Reply With Quote
  #2 (permalink)  
Old 09-15-09, 03:20 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
http://www.hotscripts.com/forums/php...t-age-dob.html

I recommend using a checkbox that has some text to the effect of "by checking this box, you indicate that you are 18 years of age or older." You can't verify the age anyway, because you can't check an id. People that are under 18 will just create new birthdates for themselves if they really want to register.
Reply With Quote
  #3 (permalink)  
Old 09-16-09, 04:29 AM
ruteckycs's Avatar
ruteckycs ruteckycs is offline
Coding Addict
 
Join Date: Jul 2009
Posts: 377
Thanks: 6
Thanked 10 Times in 10 Posts
Indeed Wirehopper is once again correct. If someone wants to get in your site they will just lie about when they were born. However, (if you are in the US at least) you can ask them to check a box, and this check will count as an 'electronic signature' so even if they lie you are covered because they have in effect sworn they are of age.
Reply With Quote
  #4 (permalink)  
Old 09-16-09, 05:20 AM
link2shahid link2shahid is offline
New Member
 
Join Date: Sep 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
both of the replies are right, but what if someone wants to calculate age, from DOB, given by the user?.required for various colleges when students fill admission form.
Reply With Quote
  #5 (permalink)  
Old 09-16-09, 08:56 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by link2shahid View Post
both of the replies are right, but what if someone wants to calculate age, from DOB, given by the user?.required for various colleges when students fill admission form.
Then they could refer to the link already provided in the post by wirehopper: http://www.hotscripts.com/forums/php...t-age-dob.html
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating Age Help jamesbuk PHP 9 03-07-09 01:21 PM
Age Band Related Calculations and display CutAndPaste Database 7 06-21-06 01:53 PM
PhP Real Age bicho PHP 12 11-07-05 07:13 PM
Win a copy of Age of Mythology gold edition + more! zenonflare General Advertisements 1 08-14-05 12:52 PM
calculating age thomas1977 ASP 2 08-04-05 12:28 PM


All times are GMT -5. The time now is 07:59 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.