RE: [PHP] validate date

2002-12-19 Thread Jon Haworth
Hi Diana, If a user inputs a date into a form, what function can I use to validate that he put in a valid date? You can't. Here are two dates in two different formats. Only one is valid. - 13/04/01 - 13/04/01 Can you spot which is which? I want to use checkdate but that needs the date

Re: [PHP] validate date

2002-12-19 Thread Manuel Ochoa
Here is a funtion that I use. A user can enter a date in any of the following ways: 01 01 03 01-01-03 1-1-03 01-1-2003 1-01/03 1/1 03 you get the idea... This function will standardize the date and make sure it's valid. If invalid it returns ERROR function fixdate($data){ $aux[0]=; $aux[1]=;

RE: [PHP] validate date

2002-12-19 Thread John W. Holmes
If a user inputs a date into a form, what function can I use to validate that he put in a valid date? I want to use checkdate but that needs the date split up into day, month year. Anyone have an easy way of doing this? You have to specify a date format to your users, or at least assume a