Jump to content

Most effiecnt way to work in a b-day


xcandiottix

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.