我遇到了引导 PHP 联系表单的问题。我使用统一主题引导框架,UI 已完成,但我不知道如何制作联系表单功能。谁能帮我改正。这是我的网站。http://cloudsblack.info/
HTML 部分。
<!-- Contact Section -->
<section id="contact" class="contacts-section">
<div class="container content-lg">
<div class="title-v1">
<h2>Contact Us</h2>
<p>I'm always happy to hear from you. Please contact or email me for appointment or service enquiry.</p>
</div>
<div class="row contacts-in">
<div class="col-md-6 md-margin-bottom-40">
<ul class="list-unstyled">
<li><i class="fa fa-home"></i> Kuala Lumpur</li>
<li><i class="fa fa-phone"></i> (6)016-7187764</li>
<li><i class="fa fa-envelope"></i> <a href="1122johnho@gmail.com">1122johnho@gmail.com</a></li>
</ul>
</div>
<div class="col-md-6">
<form method="post" action="index.php">
<label>Name</label>
<div class="row margin-bottom-20">
<div class="col-md-7 col-md-offset-0">
<input type="text" class="form-control">
</div>
</div>
<label>Email<span class="color-red">*</span></label>
<div class="row margin-bottom-20">
<div class="col-md-7 col-md-offset-0">
<input type="text" class="form-control">
</div>
</div>
<label>City</label>
<div class="row margin-bottom-20">
<div class="col-md-7 col-md-offset-0">
<input type="text" class="form-control">
</div>
</div>
<label>Telephone</label>
<div class="row margin-bottom-20">
<div class="col-md-7 col-md-offset-0">
<input type="text" class="form-control">
</div>
</div>
<label>Interested</label>
<div class="row margin-bottom-20">
<div class="col-md-7 col-md-offset-0">
<input type="text" class="form-control">
</div>
</div>
<label>Message</label>
<div class="row margin-bottom-20">
<div class="col-md-11 col-md-offset-0">
<textarea rows="8" class="form-control"></textarea>
</div>
</div>
<p><button type="submit" class="btn-u btn-brd btn-brd-hover btn-u-dark">Send Message</button></p>
</form>
</div>
</div>
</div>
这里是 PHP 部分。
<?php
$Name = $_POST['name'];
$Email = $_POST['email'];
$City = $_POST['city'];
$Telephone = $_POST['telephone'];
$Interested = $_POST['interested'];
$Message = $_POST['message'];
$from = 'From: Johnhophotography.com';
$to = 'cloudsblack84@gmail.com';
$subject = 'Message from johnhophotography.com';
$body = "From: $name\n E-Mail: $email\n City: $city\n Telephone: $telephone\n Interested: $interested\n Message:\n $message";
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>';
}
} else if ($_POST['submit']) {
echo '<p>You answered the anti-spam question incorrectly!</p>';
}
?>
谢谢 !!!