Hi I have varibales, $day, $month, $year that a form posts to the page
I am trying to validate that the date they have posted is not in the past, is there a function for this?
A smiliar function I am using is checkdate() i was wondering if there was an equivilant for this purpose
Thanks in advance
Checking a date is today or in the future
Moderator: General Moderators
- DaveTheAve
- Forum Contributor
- Posts: 385
- Joined: Tue Oct 03, 2006 2:25 pm
- Location: 127.0.0.1
- Contact:
Here combind them together in a way you can use strtotime(); to get the unix timestamp. Once you have the unix timestamp juxtapose that to the timestamp you get from time();. If strtotime(); is larger then time(); your time is in the future.
It's that easy.
Edit: Errr, volka. I thought I had first post too. lol
It's that easy.
Edit: Errr, volka. I thought I had first post too. lol
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA