Redirect to a Thank You page

When the GMAIL logo is clicked, on my contact page, a contact form pops out. I coded my contact form to redirect the user to a Thank You page, but it’s not working for some reason. Can someone enlighten me?

1.My contact page:
Untitled Document

2.PHP code: (contactformhandler.php)

$errors = '';
$myemail = '';//<-----Put Your email address here.
if(empty($_POST['name'])  || 
   empty($_POST['email']) || 
    $errors .= "\
 Error: all fields are required";

$name = $_POST['name']; 
$email_address = $_POST['email']; 
$message = $_POST['message']; 

if (!eregi(
    $errors .= "\
 Error: Invalid email address";

if( empty($errors))
	$to = $myemail; 
	$email_subject = "Contact form submission: $name";
	$email_body = "You have received a new message. ".
	" Here are the details:\
 Name: $name \
 Email: $email_address \
 Message \
	$headers = "From: $myemail"; 
	$headers .= "Reply-To: $email_address";
	//redirect to the 'thank you' page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> 
	<title>Contact form handler</title>

<!-- This page is displayed only if there is some error -->
echo nl2br($errors);


3.thank you page:
Thank you!

Try putting a space between the : and thankyou.html.

I’m not going to say it will fix it but its worth a try.

I’ve tried this already, but it didn’t help

I think you have to enclose Location: in double quotes
header(“Location: thankyou.html”);

Also try the full url (starting with http://)

Thanks :slight_smile:

I inserted “Location:” and it worked. Do you happen to know the answer to my other thread (link below)? Basically, I want the box to resize into a different shape after the email has been submitted.