The form is submitting and sending the email successfully, but the page not redirecting to google. What am I doing wrong?
<?php
$to = "test@gmail.com";
$email_title = "test from email";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = ($_POST["name"]);
$email = ($_POST["email"]);
$message = ($_POST["message"]);
$info = " Name: $name \r\n Email: $email";
if(mail($to, $email_title, $message, $info)){
header('Location: http://www.google.com/');
}
else {
echo "there is an error";
}
}
?>