<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="example@domain.com">
</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 = "alantessier97@gmail.com";
$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代码出现在我的联系页面上,它没有像它应该提交的那样。我会在这里感谢一些帮助。所以如果我在这里遗漏了一些东西,我会感激一些帮助。
此外,如果我的HTML有问题,也可以自由修复。但主要是我在我的php上寻求帮助。