if(mail($myemail, $subject, $message, $header)) { $status = "Thank you for contacting us, we will be in touch shortly<br><br>"; } else { $status = "There was a problem sending your feedback, please try again later.<br><br>"; } } else { $status .= "<br>Please press <u>back</u> on your browser to resubmit.<br><br>"; } } PHP: This is my current code... how do i get it to redirect to another page after the form is submitted? (This is for a contact form) Thanks
<script type='text/javascript'> window.location = 'newpage.php' </script> Just write above code after displaying status.
<?php if(isset($_POST['submit'])) { //put varibles in $_POST if($errors=='') { $to = "your_email@email.com"; $from_email = "$name"; $head = "From my contact page"; $msg = "\n Name: $name \n Email: $email \n\n MESSAGE: \n $messsage\n "; mail($to, $head, $msg, "From: $from_email"); } ?> <div align="center"><p>Thank you for your message. Go to the home page<a href="index.php"</p> </div> <?php } ?> PHP: