Thanks. That should have occurred to me. I've gotten it to work, sort of. If I try to intentionally trigger an error I get the error message (Either you entered...) up through 2037(using April 3 as the month and day). Using a 2038 year date the code
print "<p>You will turn $age this year.</p>";
gives me "You will turn -26 this year."
Here is the pertinent code:
//Check that they were born before the current day
$current_year = date('Y');
$today = new DateTime();
$birthday = strtotime($_POST['month']."/".$_POST['day']."/".$_POST['year']);
if ($birthday < $today->getTimestamp()) {
$age = $current_year - $_POST['year'];
//Calculate age this year
} else {
print '<p class="error">Either you entered your birth year wrong or you come from the future!</p>';
$okay = FALSE;
} //End of 2nd conditional
} else { //Else for 1st conditional
print '<p class="error">Please enter the year you were born as four digits.</p>';
$okay = FALSE;
} //End of 1st conditional
What am I doing wrong?