This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > February 2004 > date entry form





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author date entry form
newbeenewbee

2004-02-25, 3:29 pm

My users are used to entering the date in their forms as:
MM/DD/YYYY

but since my dreamweaver site is using mysql, mysql likes it as YYYY/MM/DD.

Is there a way to have my text field update the users entry "on post" or some
other way, maybe when the text box loses focus so that it converts it to mysql
format?

Gary White

2004-02-25, 4:28 pm

On Wed, 25 Feb 2004 19:28:54 +0000 (UTC), "newbeenewbee"
<webforumsuser@macromedia.com> wrote:

>My users are used to entering the date in their forms as:
> MM/DD/YYYY
>
> but since my dreamweaver site is using mysql, mysql likes it as YYYY/MM/DD.
>
> Is there a way to have my text field update the users entry "on post" or some
>other way, maybe when the text box loses focus so that it converts it to mysql
>format?


Something like this will convert it:

date("Y/m/d", strtotime($_POST['dateinput']));


Gary
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews