I need to redirect to a thankyou page after a user submit form. I am new in PHP and trying to use header("Locatio n: 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_M AIL", "jb@bwp.net ");
define("HOST_NA ME", $_SERVER['HTTP_HOST']);
define("PHP_SEL F", $_SERVER['PHP_SELF']);
define('FORM_RE CIPIENT', 'webmaster@lena pebuilder.net') ;
$isHideForm = false;
if( $HTTP_POST_VARS["formmail_submi t"] ){
header("Locatio n: 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_addre ss = $_POST['customer_addre ss'];
$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_addre ss \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 );
?>
<?php
error_reporting (E_PARSE);
define("ADMIN_M AIL", "jb@bwp.net ");
define("HOST_NA ME", $_SERVER['HTTP_HOST']);
define("PHP_SEL F", $_SERVER['PHP_SELF']);
define('FORM_RE CIPIENT', 'webmaster@lena pebuilder.net') ;
$isHideForm = false;
if( $HTTP_POST_VARS["formmail_submi t"] ){
header("Locatio n: 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_addre ss = $_POST['customer_addre ss'];
$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_addre ss \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 );
?>
Comment