I need help with my Contact Form coding. I am working on a Dreamweaver CS6 website. Could you take a look at my code and see what is wrong with it? I think, the html is fully correct. There is an error on php coding.
Html:
<form action="assets/styles/contact_form.php" method="post" class="ui-form form-contacts">
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2 class="ui-title-block">Get In Touch</h2>
<div class="ui-subtitle-block">send us a message</div>
<div class="border-color border-color_center"></div>
</div>
</div>
<div class="row">
<div class="col-sm-4 col-sm-offset-1">
<div class="input-group">
<input type="text" placeholder="NAME" name="author" required class="form-control">
</div>
<div class="input-group">
<input type="email" name="email" required placeholder="EMAIL" class="form-control">
</div>
<div class="input-group">
<input type="text" name="subject" placeholder="SUBJECT" class="form-control">
</div>
</div>
<div class="col-sm-6">
<div class="input-group">
<textarea id="comment-text" name="comment" placeholder="COMMENT" required rows="9" class="form-control"></textarea>
</div>
<div class="text-right">
<button class="btn">SEND<i class="icon fa fa-angle-double-right"></i> </button>
</div>
</div>
</div>
</div>
</form>
Php:
<?php
if(isset($_POST['user_name'])){
$author = $_POST['user_name'];
$email = $_POST['user_email'];
$to = 'john@mybusiness.ca';
$subject = $_POST['message_subject'];
$comment = $_POST['message_content'];
$headers = 'From: '. $author .' <'.$email.'>';
if(mail($to, $subject, $message, $headers)){
echo 'success';
}
else{
echo 'fail';
}
}
?>