Hi, I have a form with a field called available date which i need to make sure is correct. When posted i want to check that the date they entered is the current year e.g. 2007 and also that the entry is in this format yyyy-mm-dd. Any ideas anyone? Cheers, Adam
list($year, $month, $day) = array_map('intval', explode('-', $_POST['date'])); if ($year != date('Y') OR !checkdate($month, $day, $year)) { // Wrong year or non-existing calendar date. } PHP:
I think i spoke to soon. I am entering the following date 2007-08-13 and it is not allowing this to go through even though it is valid. Any ideas?