简体   繁体   中英

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.

<?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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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