Hi,
I have created a contact form but I cannot seem to get it working.
Within the html I have this
HTML Code:
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="contact-name" class="col-sm-2 control-label">Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="contact-name" placeholder="First and Last Name">
</div>
</div>
<div class="form-group">
<label for="contact-email" class="col-sm-2 control-label">Email</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="contact-email" placeholder="example@domain.com">
</div>
</div>
<div class="form-group">
<label for="contact-message" class="col-sm-2 control-label">Message</label>
<div class="col-sm-10">
<textarea class="form-control" rows="4"></textarea>
</div>
</div>
<button type="submit" class="btn btn-primary">Send</button>
</form>
then in contact.php I have the following
PHP Code:
<?php
$contact-name = $_POST['contact-name'];
$contact-email = $_POST['contact-email'];
$contact-message = $_POST['contact-message'];
$from = 'From: TangledDemo';
$to = 'andy_alban@outlook.com';
$subject = 'Hello';
$human = $_POST['human'];
$body = "From: $name\n E-Mail: $email\n Message:\n $message";
if ($_POST['submit'] && $human == '4') {
if (mail ($to, $subject, $body, $from)) {
echo '<p>Your message has been sent!</p>';
} else {
echo '<p>Something went wrong, go back and try again!</p>';
}
} else if ($_POST['submit'] && $human != '4') {
echo '<p>You answered the anti-spam question incorrectly!</p>';
}
?>
However it does not seem to work any ideas?
Kind Regards