仅限Contact.php表单姓名未通过

时间:2016-10-11 06:15:13

标签: php html contact-form

我的网站上有一个非常简单的联系表格,所有字段都来自我搜索和搜索过的名字,但无法找到原因。我还尝试在名为fullname的下面添加一个新字段,它也不会工作但是当我尝试设置手机和移动设备时它们都能正常工作......这对任何人都有帮助是非常令人沮丧的吗?

下面是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');

&GT;

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

1 个答案:

答案 0 :(得分:3)

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

没有名字的类型。

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