Karla Van Der Sluis
Karla Van Der Sluis

Reputation: 9

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 = '[email protected]';
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 = "[email protected]";
$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>

Upvotes: 0

Views: 54

Answers (1)

Parth Chokshi
Parth Chokshi

Reputation: 652

<input type="text" name="name">

There is no type of name.

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

Upvotes: 3

Related Questions