I'm trying to add redirection to a URL to the following script. I can't seem to be able to make it work after clicking the button. Any suggestions for how to make it work? Thanks in advance!
if ($Email=="") {
echo "<div class='alert alert-error'>
<a class='close' data-dismiss='alert'>×</a>
<strong>Warning!</strong> Please enter your email.
</div>
";
}
elseif ($Name=="" or $PhoneDay=="") {
echo "<div class='alert alert-error'>
<a class='close' data-dismiss='alert'>×</a>
<strong>Warning!</strong> Fill all the required fields.
</div>";
}
else{
mail($to, $subject, $msg, "From: $_REQUEST[Email]");
echo "<div class='alert alert-success'>
<a class='close' data-dismiss='alert'>×</a>
<strong>Thank you!</strong>
</div>";
header("Location: http://www.example.com");
}
?>