-1
<div class="row" id="box2" >
<div class="col-xs-12 center-block text-center">
<h1>Get In Touch</h1><br>
<?php
if($_SERVER['REQUEST_METHOD'] != 'POST') {
$self = $_SERVER['PHP_SELF'];
?>
<form class="form-horizontal" role="role" method="post" name="contactform" action="<?php echo $self; ?>">
<div class="form-group">
<label for="name" class="col-xs-4 col-sm-4 col-md-2 control-label">Name</label>
<div class="col-xs-8 col-sm-8 col-md-10">
<input type="text" class="form-control" name="cusname" id="name" placeholder="Your Name">
</div>
</div>
<div class="form-group">
<label for="email" class="col-xs-4 col-sm-4 col-md-2 control-label">Email</label>
<div class="col-xs-8 col-sm-8 col-md-10">
<input type="text" class="form-control" name="cusemail"id="email" placeholder="[email protected]">
</div>
</div><div class="form-group">
<label for="subject" class="col-xs-4 col-sm-4 col-md-2 control-label">Subject</label>
<div class="col-xs-8 col-sm-8 col-md-10">
<input type="text" class="form-control" id="subject">
</div>
</div>
<div class="form-group">
<label for="message" class="col-xs-4 col-sm-4 col-md-2 control-label">Message</label>
<div class="col-xs-8 col-sm-8 col-md-10">
<textarea class="form-control" id="message"></textarea>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success text-center">Send</button>
</div>
</form>
<?php
} else {
$name = $_POST['cusname'];
$email = $_POST['cusemail'];
$subject = $_POST['cussubject'];
$reason = $_POST['cusmessage']
$emailto = "a[email protected]";
$sub = "Filled in form from website"
$header = "From = $name <$email>\r\nReply-To: $email\r\n";
$header .= "MIME.Verson 1.0\r\n";
$header .= "Content-type: text/html; charset=iso-8859-1\r\n";
$message = "From : $name, Email : $email<br /><hr />$reason";
mail($emailto, $sub, $message, $header);
echo "Thank you for contacting us.";
}
?>
</div>
</div>
我的代碼無法正常工作,PHP一直在採取行動。我真誠地,不知道任何PHP,我在網上找到這個代碼。我嘗試了一堆代碼,但似乎沒有工作,我厭倦了搜索。所以如果有人能幫我找到這個工作,那會很棒!例如,php代碼出現在我的聯繫頁面上,它不會像它應該那樣提交。我希望在這裏得到一些幫助。所以如果我在這裏錯過了一些東西,我會很感激一些幫助。PHP聯繫表格無法正常工作,表格無法正確顯示
此外,如果我的html有問題,也可以自由修復。但主要是我在尋找幫助我的PHP。