Thanks, I think I have it: $dateexplode = explode("-", $_POST["date_entered"]); if (!preg_match("/^(\d{2})$/", $dateexplode[0],$data1) || !preg_match("/^(\d{2})$/", $dateexplode[1],$data2) || !preg_match("/^(\d{4})$/", $dateexplode[2],$data3)) { die ("you have entered an invalid date"); } so if the person enters 01-15-2008 its fine, but 1-15-2008 dies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php