Hi there I need help on just this one thing then my site is complete.
I have a Bootstrap Contact form inside my modal, but I can’t get the PHP to capture and send the information to my email address.
My Bootstrap Form:
<form class="form-horizontal" role="form" method="POST" action="process.php">
<div class="form-group">
<label class="control-label col-sm-2" for="fname" style="color:white">Your Full Name:</label>
<div class="col-sm-10">
<input type="fname" class="form-control" id="fname" placeholder="Enter your full name...">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="email" style="color:white">Your Email:</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="email" placeholder="Enter your email...">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="message" style="color:white">Your Message:</label>
<div class="col-sm-10">
<textarea class="form-control" row="8" placeholder="Enter your message..."></textarea>
</div>
</div>
</form>
Here is my PHP:
<?php
$fname = $_POST['fname'];
$email = $_POST['email'];
$message = $_POST['message'];
$submit = $_POST['submit'];
if($submit){
$from = 'From: -removed-domain-'."\r\n";
$to = 'info@momentdesigns.co.za';
$subject = "Message from -removed-domain-";
$body = "".
"From: ".$fname."\n".
"E-mail: ".$email."\n".
"Message: ".$message."\n";
if(mail($to, $subject, $body, $from)){
echo '<p>Your message has been sent!</p>';
}
else{
die('<p>Something went wrong, go back and try again!</p>');
}
}
?>