我已经在一个模板上工作了一年,我在网上发现,他们的联系形式是非常有趣的,我不想改变它,但我仍然想添加一个PHP处理程序页面,它是功能性的,我设法写这个,但它仍然不工作。谁能告诉我我错在哪里?
这是我的html:
<div class="row justify-content-center">
<div class="col-md-7">
<form method="post" data-aos="fade" action="contact-form-handler.php">
<div class="form-group row">
<div class="col-md-6 mb-3 mb-lg-0">
<input type="text" class="form-control" placeholder="First name">
</div>
<div class="col-md-6">
<input type="text" class="form-control" placeholder="Last name">
</div>
</div>
<div class="form-group row">
<div class="col-md-12">
<input type="text" class="form-control" placeholder="Subject">
</div>
</div>
<div class="form-group row">
<div class="col-md-12">
<input type="email" class="form-control" placeholder="Email">
</div>
</div>
<div class="form-group row">
<div class="col-md-12">
<textarea class="form-control" id="" cols="30" rows="10"
placeholder="Write your message here."></textarea>
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<input type="submit" class="btn btn-primary py-3 px-5 btn-block" value="Send Message">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
我的php:
<?php
$name= $_post ['name'];
$visitor_email = $_post ['email'];
$message = $_post ['message'];
$email_form = "contact@asineedit.com";
$email_subject = "new form submition";
$email_body = "user name: $name.n".
"user email: $vistor_email.n".
"user message:$message.n";
$to = "mouad@asineedit.com";
$headers ="from: $email_from rn";
$headers .="reply-to:$visitor_emailrn";
mail($to,$email_subject,$email_body,$headers);
header("location: News & updates.html");
添加属性& name"标签"input">
<input name="name" type="text" class="form-control" placeholder="First name">
<input name="email" type="email" class="form-control" placeholder="Email">
<textarea name="message" class="form-control" cols="30" rows="10" placeholder="Write your message here."></textarea>
<?php
$name= $_POST['name'];