Forum Moderators: coopster
if (($day < $today)&&($cMonth <= $month)){
echo "<p>This date has Passed, Please choose another</p>";
}elseif (($cMonth < $month)&&($cYear <= $year)){
echo "<p>This date has Passed, Please choose another</p>";
}elseif (($cMonth >= $month)&&($cYear >= $year)){
echo "You are about to book a lesson for <div class=\"everyday\">$day $cMonth $cYear</div>";
}else{
echo "You are about to book a lesson for <div class=\"everyday\">$day $cMonth $cYear</div>";
}
?>
I'd recommend converting the dates to time stamps and comparing those directly. Something along these lines:
$request_date = mktime( 0,0,0, $_GET['cMonth'], $_GET['day'], $_GET['cYear']);
$today = mktime(0,0,0, date('j'), date('n'), date('Y'));
if($request_date <= $today){
echo '<p>This date has Passed, Please choose another</p>';
} else{
echo 'You are about to book a lesson for <div class="everyday">'.date('j n y', $request_date ).'</div>';
}