RE: [PHP] Date Validation, Kinda'

2003-08-21 Thread Jay Blanchard
[snip] I'm thinking this: 1. you get the date from the user 2. validate it using checkdate() 3. get the current date 4. compare the two dates to see if the users date is later than todays date 5. return true or return false Sound good? [/snip] Sounds bueno! I am just tired, had checkdate() in ha

RE: [PHP] Date Validation, Kinda'

2003-08-21 Thread Chris W. Parker
Jay Blanchard on Thursday, August 21, 2003 1:24 PM said: > It is to make sure that the user has entered a valid future date in > the MMDD format into the form. (You may very well already know of these two functions and already thought of what I'm going to tell y

RE: [PHP] Date Validation, Kinda'

2003-08-21 Thread Jay Blanchard
[snip] Now that I'm thinking about it, what is your goal with this? Is it to make sure the date entered is within a certain range when compared to another date? i.e. The date entered cannot be more than absolutevalue(10 days) away from the first date or is it just to make sure it's in the proper fo

RE: [PHP] Date Validation, Kinda'

2003-08-21 Thread Chris W. Parker
Jay Blanchard on Thursday, August 21, 2003 12:30 PM said: > Has anyone written any date validation function or sequence. Now that I'm thinking about it, what is your goal with this? Is it to make sure the date entered is within a certain range when compared to anoth

Re: [PHP] Date Validation, Kinda'

2003-08-21 Thread Brent Baisley
I wrote a little function to check if a date is valid. All the hard stuff is done by the checkdate() function, but function just returns a date if valid or false if not: function validDate($year,$month,$day) { if(checkdate($month,$day,$year)) { return date("Y-m-d", mktime(0,0,0,$month,$day,$ye