By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,890 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,890 IT Pros & Developers. It's quick & easy.

redirect to a thankyou page

P: 1
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 );
?>
Feb 13 '08 #1
Share this Question
Share on Google+
5 Replies


harshmaul
Expert 100+
P: 490
Hi,
Are you getting an error? if so what is the error message?
Feb 13 '08 #2

Markus
Expert 5K+
P: 6,050
Could you re-explain the problem please?
Feb 13 '08 #3

ronverdonk
Expert 2.5K+
P: 4,258
I don't understand this part of your thread:
..... and trying to use header("Location: thankyou.html"); but it is going to thankyou page .....
what is that last 'thankyou' page??

Ronald
Feb 13 '08 #4

100+
P: 118
For the errors, try using

error_reporting(E_ALL);

ini_set("display_errors", true);

That will give you any error that occurs.

If you have header location as thankyou.html, it will go to the thankyou page, do you not think?
Feb 13 '08 #5

nomad
Expert 100+
P: 664
For the errors, try using

error_reporting(E_ALL);

ini_set("display_errors", true);

That will give you any error that occurs.

If you have header location as thankyou.html, it will go to the thankyou page, do you not think?
you might want to think of a redirect section that will open the link above if it is True if it fails then it does something....
it might look some thing like this
// redirect to success page
if ($success){
code here;
}
else{
some more code here;
}



nomad
Feb 13 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.