I have an email form, that i'm validating a date, its a booking form. What im doing is when the start date is bigger than the end date it gives me a message saying to fix the date and redirect to the page. I have 2 pages, the page of the booking form, and when i click to submit it goes to the contact_engine page to validate and send the email:
here is how i put it:
if ($datebegin >= $dateend){
echo '<script>alert("Fix the Date");</script>';
exit;
The problem is when it does the exit it stays in the functions page, and i want it to exit but go to the previous page. Can someone give me some help? I tried instead using exit
. I try to use it with header("Refresh: 1; url=http:/website.com/booking.php");
but somehow this takes me to the to the sent_page_booking page
.