xcandiottix Posted June 9, 2010 Share Posted June 9, 2010 So i'm working on a submission form and I'd like to get users birthday. Afterwards though I would like a php script to be able to kick back that X user is X years old. I have a javascript form built that has a drop down for each month, day, and year. When I save it to the database whats the best way to do it so that php can easily relate that to a year of age. I know there's a lot of date functions in php but i'm confused as to the best way to go about it. I'm thinking: Javascript outputs to mysql 11091982 (11/09/1982) PHP takes todays date ... can i use date(m,d,y)? and subtracts 11091982 and comes up with $age=27 ?? Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.