if compare statement
Posted: Fri Mar 21, 2014 2:50 pm
Please tell me if following answer is correct
Question : User has filled a form where he had to put date of birth , need to code a couple of php statement which should do verification of date of birth , if the date of birth of birth is in future date from today then an error should come up .
answer:
$dob = $day . $month . $year; // this will combine day , month and year as they were taken as different values
if $now < $dob; // this is if statement which matches NOW time with input dob
echo " Please enter correct date of birth";
Question : User has filled a form where he had to put date of birth , need to code a couple of php statement which should do verification of date of birth , if the date of birth of birth is in future date from today then an error should come up .
answer:
$dob = $day . $month . $year; // this will combine day , month and year as they were taken as different values
if $now < $dob; // this is if statement which matches NOW time with input dob
echo " Please enter correct date of birth";