Hey everyone!
I have a PHP mailer setup on my website and I have a question on how I can enhance it a little. The php mailer page can be found here.
It’s just a basic form with the action set to “mailer.php”. The php is made up of
<?php
if(isset($_POST['action'])) {
$to = "(email editted out)";
$subject = "New Messege";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$messege = $_POST['messege'];
$body = "From: $name_field
Email: $email_field
Messege:
$messege";
echo "Your messege has been sent, please press the back button to return home.";
mail($to, $subject, $body);
} else {
echo "Error!";
}
?>
What I want to do is when someone submits the form sucessfully rather then echoing the messege “Your messege has been setn, please press the back buttom to return home.” I want it to take them to a different .html page.
Can anyone help me with how this should be rewritten to do what I had in mind?
All comments appreciated. Thanks in advance!