Hi everyone, So I have a very simple contact form as follows: <?php if(isset($_POST["email"])){ $headers = "From: ".$_POST
use header('Location: http://sitetogot . com /page/to/go/to.php'); Code (markup): one caveat: you should call header prior to echoing or printing
<?php if(isset($_POST["email"])){ $headers = "From: ".$_POST[email]."\r\n"; $headers .= "Content-type: text/html\r\n"; $message = " <br />Name: $_POST[name] <br />E-mail: $_POST[email]<br /><br />$_POST[msg] "; mail("myemail@mydomain.com", "Website Form Submission", $message, $headers); // put your page here header("Location: http://site.com/thanx.html"); } ?> PHP:
yep, dont forget to use exit; Please use this code, it is more easy to modify : <?php if(isset($_POST["email"])){ $thanks_page = 'Your Page URL here'; // Change it $title = 'Website Form Submission'; // Change it $email_owner = 'Your Email here'; // Change it $headers = "From: ".$_POST[email]."\r\n"; $headers .= "Content-type: text/html\r\n"; $message = " <br />Name: $_POST[name] <br />E-mail: $_POST[email]<br /><br />$_POST[msg] "; mail($email_owner, $title, $message, $headers); header("Location: $thanks_page"); exit; } ?> PHP: Thank you