Hi guys I have the ff codes:
<?php $name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name n Message: $message";
$recipient = "[email protected]";
$subject = "Chick SEO Contact Form: New Email from $name";
$mailheader = "From: $email rn";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank you!";
?>
Right now its only redirecting the page to a simple echo page with text "Thank you"
Is there anyway we can redirect the user to this URL https://recurpost.com/ once the form was submitted and the email was sent instead of sending it to echo?
2
Answers
You need to use the Php header function. Instead of the echo, you can use the following:
The above code will include a "location" header in the Http response. This will cause the browser to redirect the user to the given url. See the documentation for the header function
Try using