I need some help to understand why I cannot get the form to return to the index.html page after its submitted. The form works fine and the email comes through but once submitted the website goes to an error page (file not found, 404 error).
<!-- begin snippet: js hide: false console: true babel: false -->
<?php
$name = $_POST ['name'];
$vistor_email = $_POST['email'];
$email_from = 'enquires@emergencyplumbers247.com';
$email_subject = "newsletter submission";
$email_body = "User Name: $name.\n".
"User Email: $vistor_email.\n";
$to = "newsletter@emergencyplumbers247.com";
$headers = "From: $email_from \r\n";
$headers .= "Reply-To:$vistor_email \r\n";
mail($to,$email_subject,$email_body,$headers);
header("Location: index.html")
?>
this is the PHP I've used. I've changed the header location to index.html but not having any joy in getting it to return to the index.html page.
<!-- Newsletter -->
<section>
<div class="container text-center">
<div class="newsletter mt-3 mb-3 p-4">
<form id="contact-form" method="post" action="./php/contact-form-handler.php">
<h5>Sign up to our newsletter</h5>
<p>Recieve the lastest news and offers by signing up today.</p>
<div class="form-group text-center">
<label for="input-name" class="sr-only">Your Name:</label>
<input type="text" name="name" class="form-control text-center" placeholder="full name" id="input-name" required>
</div>
<div class="form-group text-center">
<label for="input-email" class="sr-only">Your Email:</label>
<input type="email" name="email" class="form-control text-center" placeholder="mail@example.com" id="input-email" required>
</div>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" id="input-terms" value="terms">
I have read and accept the <a href="#" data-toggle="modal" data-target="#modal"> terms and conditions.</a>
</label>
</div>
<div>
<small class="form-text">You can unsubscribe from the mailing list at anytime</small>
<button type="submit" class="m-1 btn btn-light">SIGN UP</button>
</div>
</form>
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalTitle" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalTitle">Terms and Conditions</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p> Emergency Plumbers 24-7 do not sell or forward any personal information, we use highly reliable And stable service which is protected by the latest technology. We are unable like every other company to protect your information 100%, but
we take this very seriously and have every form of protection in place to ensure all areas are covered and protected to our best ability.
</p>
<p> The only information we hold is your email and name, this is forward on only back to you or our system administrators for the marketing of our own products, offers and services. Under no circumstances would we ever give or use your details
for third-party companies.
</p>
<p> Should you wish for your details to be removed from our system simple send an email to unsubscribe@emergencyplumbers247.com, This process may take up to 48 hours. We promise not to spam and to only share information and offers that will
benefit our customers.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">close</button>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- NEWSLETTER END-->