简体   繁体   English

仅Contact.php表单名称未通过

[英]Contact.php form only Name not coming through

I have a very simple contact form on my site and ALL the fields come through apart from Name I have searched and searched and cant find a reason for this. 我的网站上有一个非常简单的联系表,除我搜索过的姓名外,所有其他字段均通过此字段输入,并且找不到原因。 I have also tried to add a new field underneath called fullname and it also wont work but when I try to set up phone and mobile they both work... this is incredibly frustrating can anyone help? 我还尝试在下方添加一个名为“全名”的新字段,但也无法正常工作,但是当我尝试设置电话和移动设备时,它们都可以工作...令人沮丧的是,有人可以帮忙吗?

below is the contact.php and the HTML the site is 38miro.co.nz if that will help anyone. 下面是contact.php和HTML站点,如果可以帮助任何人,则为38miro.co.nz。

<?php
$myemail = 'karlamarievds@gmail.com';
if(empty($_POST['name']) ||
   empty($_POST['phone']) ||
   empty($_POST['email']) ||
   empty($_POST['message']))

$fullname = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$message = $_POST['message'];


$to = "karlamarievds@gmail.com";
$subject = "38 Miro Street inquiry: $fullname";
$body = "You have received a new inquiry about 38 Miro Street. \n\n This is        a automated email generated from the online request form \n\n Please find below details: \n\n Name: $name \n\n Email: $email \n\n Phone: $phone \n\n Message: $message";

   $headers = "From: $myemail\n";
  $headers = "Reply-To: $email";


  mail ($to,$subject,$body,$headers);
  header('Location: thank-you.html');

?> ?>

        <div class="col-md-6 col-sm-7">
            <div class="contact_detail">
                <div class="section-title">
                    <h3>Send Message Here</h3>
                </div>
                <form action="contact.php" method="POST">
                    <input type="name" class="form-control" name="name" placeholder="name" required>
                    <input type="tel" class="form-control" name="phone" placeholder="phone" required>
                    <input type="email" class="form-control" name="email" placeholder="email" required>
                    <textarea class="form-control" name="message" placeholder="message" rows="5" required></textarea>
                    <div class="col-md-6 col-sm-10">
                        <input type="submit" class="form-control" value="Send Now">
                    </div>
                </form>
            </div>
        </div>
<input type="text" name="name">

There is no type of name. 没有名称类型。

http://www.w3schools.com/tags/att_input_type.asp http://www.w3schools.com/tags/att_input_type.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM