I need to redirect to a thankyou page after a user submit form. I am new in PHP and trying to use header("Location: thankyou.html"); but it is going to thankyou page. Everything else seems to be working fine - Please help me out !!!
<?php
error_reporting(E_PARSE);
define("ADMIN_MAIL", "jb@bwp.net");
define("HOST_NAME", $_SERVER['HTTP_HOST']);
define("PHP_SELF", $_SERVER['PHP_SELF']);
define('FORM_RECIPIENT', 'webmaster@lenapebuilder.net');
$isHideForm = false;
if( $HTTP_POST_VARS["formmail_submit"] ){
header("Location: thankyou.html");
exit();
}
?>
<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$customer_name = $_POST['customer_name'];
$customer_email = $_POST['customer_email'];
$customer_address = $_POST['customer_address'];
$customer_city = $_POST['customer_city'];
$customer_state = $_POST['customer_state'];
$customer_zip = $_POST['customer_zip'];
$customer_phone = $_POST['customer_phone'];
$customer_email = $_POST['customer_email'];
$todayis = date("l, F j, Y, g:i a") ;
$message = " $todayis [EST] \n
Name: $customer_name \n
Address: $customer_address \n
City: $customer_city \n
State: $customer_state \n
Zip: $customer_zip \n
Phone: $customer_phone \n
";
$from = "From: $customer_email\r\n";
mail("webmaster@lenape.net", $subject, $message, $from );
?>