';
}
$lastName=trim($lastName);
if(empty($lastName)) {
$ok=false;
echo 'The last name can not be blank
';
}
if(empty($gender)) {
$ok=false;
echo 'Please select male or female
';
}
$birthdate=mktime(0,0,0,$month,$day,$year);
//if not a valid date, such as Sept. 31, or Feb. 29 in a non-leapyear, it wraps over to next mont, ie Oct. 1 or March 1.
$format1="$month/$day/$year";
$format2=date("n/j/Y",$birthdate);
if($format1!=$format2) {
$ok=false;
echo 'The date you entered is not a valid date
';
}
if($ok) echo 'The information is complete.
'; //can be entered in database
}
else echo 'Please complete all information and press submit
';
?>
';
if(isset($firstName)) echo '$firstName='.$firstName.'
';
else echo 'NO value for $firstName
';
if(isset($lastName)) echo '$lastName='.$lastName.'
';
else echo 'NO value for $lastName
';
if(isset($gender)) echo '$gender='.$gender.'
';
else echo 'NO value for $gender
';
echo "Birthdate=$month/$day/$year
";
$age=$curYear-$year;
echo 'Age='.$age.'
';
echo "Previous conditions: ";
if(isset($asthma)) echo 'asthma ';
if(isset($hypertension)) echo 'hypertension ';
if(isset($cancer)) echo 'cancer ';
echo "
Reason for visit: $reason
";
?>