The submit button is in contact-us.html
, the code is in contact-us.php
.
I tried to use the header('Location: example');
with no luck... (I tried using the URL of the page as well: header('Location: http://www.example.com/contact-us.html');
)
Any thoughts?
<?php
if($_POST["submit"]) {
$recipient="example@gmail.com";
$subject="Form to email message";
$sender=$_POST["firstname"];
$senderlast=$_POST["lastname"];
$senderemail=$_POST["senderemail"];
$message=$_POST["message"];
$mailBody="First Name: $sender\nLast Name: $senderlast\nEmail: $senderemail\n\nMessage: $message";
header('Location: /contact-us.html'); /*Something Wrong?*/
mail($recipient, $subject, $mailBody, "From: $sender <$senderemail>")
}