I have a PHP form which includes 3 fields for person birthday: iBirthday, iBirthMonth (int 1 thru 12), and iBirthYear (int 4 digits)
I am trying to calculate if the person is older than 18 years, when pressing submit, before running the SQL INSERT.
How can i calculate this? I have no idea how to concatenate these 3 int into a date, and compare to current date.
I have some tests that work, for example
//Check if gender is NULL
if ($iGender == '') {
$sTopError = gettext('Did not select Gender');
$bErrorFlag = true;
}
I would like to do a similar test, that says: "Person not above 18 years".