Could you please help me with my code? I have a contact form that is linked to a php. it is not sending emails. It just redirects me to my contact-form.php.
Heres the html:
<div class="wrapper">
<h2>Contact us</h2>
<div id="error_message"></div>
<form id="myform" onsubmit="return validate();" action="contact-form.php">
<div class="input_field">
<input type="text" placeholder="Name" id="name">
</div>
<div class="input_field">
<input type="text" placeholder="Subject" id="subject">
</div>
<div class="input_field">
<input type="text" placeholder="Phone" id="phone">
</div>
<div class="input_field">
<input type="text" placeholder="Email" id="email">
</div>
<div class="input_field">
<textarea placeholder="Message" id="message"></textarea>
</div>
<div class="btn">
<input type="submit">
</div>
</form>
</div>
<div class="home">
<a class="" href="index.html">Back to main page</a>
</div>
here's the php:
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$phone = $_POST['phone'];
$subject = $_POST['subject'];
$email = $_POST['email'];
$message = $_POST['message'];
$mailTo = "removedmyemai@email.com";
$headers = "From: ".$mailFrom;
$txt = "You have received an email from ".$name.".\n\n".$message;
mail($mailTo, $phone, $txt, $headers);
header("Location:http://removedmysite.com/index.html")
}
?>
Thanks in advance!
Best regards.