This question already has an answer here:
Here is my html and PHP code, when I submit the form data, it targets me to the blank window where no errors are been reported neither the data is been sent to the mail, to be further noted my PHP display error and display startup errors are on.
HTML
<!-- form start -->
<form action="mail_handler.php" method="post" name="form" class="form-box">
<div class="col-sm-6">
<div class="form-group">
<input type="text" name="name" class="form-control" placeholder="Your Name">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<input type="email" name="email" class="form-control" placeholder="Your Email">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<input type="tel" name="phone" class="form-control" placeholder="Your Phone Number">
</div>
<div class="col-sm-12">
<div class="textarea-message form-group">
<textarea name="msg" class="textarea-message form-control" placeholder="Your Message" rows="5">
</textarea>
</div>
</div>
<div class="text-center">
<button type="submit" class="load-more-button">submit
</button>
</div>
</form>
PHP
<?php
if(isset($_POST['submit']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$msg=$_POST['msg'];
$to='xyz@gmail.com';
$subject='Form Submission';
$message="Name :".$name."
"."Phone :".$phone."
"."Wrote the following :"."
".$msg;
$headers="From: ".$email;
if(mail($to, $subject, $message, $headers))
{
echo "<h1>Sent Successfully! Thank you"." ".$name.", We will contact you shortly!</h1>";
}
else
{
echo "Something went wrong!";
}
}
?>
</div>