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 split up 
> into day, month year. Anyone have an easy way of doing this?

You could try separate drop-downs: one for day (with numbers 1-31), one for
month (with names) and one for years (whatever you need). This gives you
three variables that you can easily pass to checkdate().

Don't fall into the trap of thinking that if you put some text on your form
saying "please enter dates in mm-dd-yy format" that that's what you'll get,
unless you *really* know your audience.

Cheers
Jon



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to