I have a form that is to submit a date via 3 drop down boxes. I currently have the form submitting to itself then checking to make sure the date is valid.
if(isset($_POST['submit']))
{
$day = $_POST['day'];
$year= $_POST['year'];
$month=$_POST['month'];
$date= $year.'-'.$month.'-'.$day;
//**********************************Validate Date
if (!checkdate($month,$day,$year)){
echo $error= "Invalid Date Please Renter";
}
}
I am curious how I should go about going to the next page with the variables if the date is valid.
I am thinking header('Location: nextpage.php');
and using Session()
? it workss but I am wondering if that is the CORRECT way.