Soldato
i'm new to php, and I cant figure out how to do this if statement.
I've got a registration form and I'm trying to add validation to each of the inputs, but i'm stumped on the date of birth one. If users aren't 18 I need it to tell them that they cant register. What I came up with is below, and it doesn't seem to wanna work (probably cos its completely wrong
):
if ($year < 1988 and $month > 10) then;
echo "You must be 18 years of age to register";
How do i need to change it? apart from the actual maths regarding how it works out that they are 18 cos i know thats wrong already
I've got a registration form and I'm trying to add validation to each of the inputs, but i'm stumped on the date of birth one. If users aren't 18 I need it to tell them that they cant register. What I came up with is below, and it doesn't seem to wanna work (probably cos its completely wrong

if ($year < 1988 and $month > 10) then;
echo "You must be 18 years of age to register";
How do i need to change it? apart from the actual maths regarding how it works out that they are 18 cos i know thats wrong already
Last edited: