please help me with following contact form.
I made a contact form following a tutorial. Uploaded it on wamp as well to test it. But I still keep getting an error, but I am really unable to find what's the error. Maybe because I am unaware of PHP. Can someone please check my code and let me know the problem. I believe the problem is a very small one. Thank you.
<?php
$name = $_POST['InputName'];
$email = $_POST['InputEmail'];
$message = $_POST['InputMessage'];
$from = 'From: Blueblink - contact';
$to = 'kkalamarz@gmail.com';
$subject = 'Hello';
$body = "From: $name\n E-Mail: $email\n Message:\n $message";
?>
<?php
if ($_POST['submit']) {
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>';
}
}
?> // Php form: contactform.php //
<form role="form" action="contactengine.php" method="post" >
<div class="col-md-6">
<div class="form-group">
<label for="InputName">Twoje imie</label>
<div class="input-group">
<input type="text" class="form-control" name="InputName" id="InputName" placeholder="Name" required>
<span class="input-group-addon"><i class="glyphicon glyphicon-ok form-control-feedback"></i></span>
</div>
</div>
<div class="form-group">
<label for="InputEmail">Email</label>
<div class="input-group">
<input type="email" class="form-control" id="InputEmail" name="InputEmail" placeholder="Email" required >
<span class="input-group-addon"><i class="glyphicon glyphicon-ok form-control-feedback"></i></span>
</div>
</div>
<div class="form-group">
<label for="InputMessage">Wiadomość</label>
<div class="input-group">
<textarea name="InputMessage" id="InputMessage" class="form-control" rows="5" required></textarea>
<span class="input-group-addon"><i class="glyphicon glyphicon-ok form-control-feedback"></i></span>
</div>
</div>
<input type="submit" name="submit" id="submit" value="Wyślij" class="btn wow tada btn-embossed btn-primary pull-right">
</div>
</form> // Website code //