Reputation: 5
In the following php script Dreamweaver is giving me a syntax error every time I add the redirect header:
header('Location: thankyou.htm');
The info is sent to my email address with no problem but the client is not redirected to the thankyou.htm page. Does not matter whether or not I enter the full url. Sincerely appreciate any help. Please keep explanation simple - THANK YOU!!
PLEASE SEE BELOW...
<?php
$senderName = $_POST['name'];
$senderEmail = $_POST['email'];
$sendToEmail = "[email protected]";
$emailMessage = $_POST['message'];
$recipient = "$sendToEmail";
$headers = "From: $senderEmail ";
$message = "From: $senderName, \nEmail Address: $senderEmail\nMessage: $emailMessage";
$message = StripSlashes($message);
mail($recipient, "Heather's Artwork", $message, $headers)
header('Location: thankyou.htm');
?>
Upvotes: 0
Views: 90
Reputation: 60516
You are missing a semicolon (;
) at
mail($recipient, "Heather's Artwork", $message, $headers); <-- here
Upvotes: 4