I made a form in php and after submitting the form, I wanna redirect to aboutus page, the form is working fine and Im getting proper mail but I just need redirection.
here is my code
<?php if (isset($_POST['submit'])) { $to = "myemailhere@mail.com"; $from = $_POST['email']; $name = $_POST['name']; $phone = $_POST['phone']; $email = $_POST['email']; $subject = $_POST['subject']; $subject = "Form submission"; $message = "Query Request from:" . "\n\n" . "Name : " . $_POST['name'] . "\n\n" . "Email : " . $_POST['email'] . "\n\n" . "Number : " . $_POST['phone'] . "\n\n" . "Subject : " . $_POST['subject'] . "\n\n" . "Message : " . $_POST['message']; $headers = "From:" . $from; $headers2 = "From:" . $to; mail($to, $subject, $message, $headers); mail($from, $subject2, $message2, $headers2); echo '<script type="text/javascript">'; echo ' alert("Mail Sent. Thank you, we will contact you shortly.")'; //not showing an alert box. redirect('/index.php'); echo '</script>'; } ?>