if($_POST['syear']){
$compy = strtotime($_POST['syear']);
if(date("Y") <= date("Y", $compy)){
//success
$startdate = $_POST['syear'];
}
else{
$error = 6;
}
}
I have created the above code and have no idea where I have gone wrong. I am posting a string from a form with a number in it and want to compare it to the current year. If the number is equal to or less than the current year it is supposed to be a success. It is always a success even if the number is larger than the current year. Do I need to convert some strings to ints or have I missed something entirely.