Search
Left Quote    Wise men speak because they have something to say; Fools because they have to say something.
- Plato (427-347 B.C.)    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Date of Birth...
  This user is offline  Genius
  Subject: "Date of Birth..." Posted: @ 9:02 pm on Mar 03 2008   

Member #: 582
Rank: User - (77)
Since: 02/18/08
Posts: 76
From: kmmk

Ok, I'm working on advancing my register.php. I just don't know how to make a form for Date of Birth that will eventually send to database. If you know how to do it, please post it here. Thanks.


    Viewed: 6,774 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Date of Birth..." Posted: @ 12:39 am on Mar 05 2008    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

I think there are tons of ways you could do it. You need to define the parameters in which format you would like the data, and force the end user to adhere to those parameters.

For example, if you want DOB in this format: mmddyyyy then setup the column in the database with a max character limit of 8 (because you know it cannot exceed that). So in the coding, check the same. Also check to validate that the variable is numeric. If it is not, you know something was entered in wrong. Also, you could setup your script to associate an age based on their input vs. today, to determine if they need a special flag (like a minor) which may need restricted to some areas, or require additional information.

So I hope I answered your question. It can be as simple or as complex as you wish. How important is user DOB to your site? Also be aware that the DOB its based on the input from the user, so theres no true way to know if they're supplying a correct date or not. You could block them from entering in ages <=5 or >=115 or something to make them think a little harder before typing in a false number.

You may also consider providing combo boxes with month, day, year. This would probably be the best really for both you and the user. Less chance of error by the user, and easier and less coding for you. Good luck!



Edited at 12:48:05 am on 03/05/08


-bs0d | AllSyntax.com

    Viewed: 6,757 Times | Reply to This | To top
  This user is offline  Genius
  Subject: "re: Date of Birth..." Posted: @ 2:35 am on Mar 06 2008    

Member #: 582
Rank: User - (77)
Since: 02/18/08
Posts: 76
From: kmmk

Thanks for your replay.

All I need to learn is how I will transfer it to mysql. Im intending to use tables, like day then month then year type box. Don't know how to combine them and transfer it to database.

I need D.O.B for my site for user info. I don't really needed, but it may be helpful in the future.




    Viewed: 6,738 Times | Reply to This | To top
  This user is offline  Genius
  Subject: "re: Date of Birth..." Posted: @ 4:29 am on Mar 09 2008    

Member #: 582
Rank: User - (77)
Since: 02/18/08
Posts: 76
From: kmmk

Nevermind.... Got it to work after some peeking to other scripts



Edited at 04:29:57 am on 03/09/08


    Viewed: 6,700 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Date of Birth..." Posted: @ 9:06 am on Mar 09 2008    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

OK cool, glad you found what you wanted.




-bs0d | AllSyntax.com

    Viewed: 6,694 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank