Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
引导联系人表单中的PHP无法正常工作,有人能找出我做错了什么吗?_Php_Html_Forms_Twitter Bootstrap_Email - Fatal编程技术网

引导联系人表单中的PHP无法正常工作,有人能找出我做错了什么吗?

引导联系人表单中的PHP无法正常工作,有人能找出我做错了什么吗?,php,html,forms,twitter-bootstrap,email,Php,Html,Forms,Twitter Bootstrap,Email,我已经为我的网站制作了一个联系表单,包括html和php,它确实会发送一封显示“name:email:message:”的电子邮件,但之后它是空的,因此它不会显示您在表单中键入的内容,请帮助 以下是html: <form action="thankyou.php" method="post"> <div class="col-md-5" style="margin-top:15px;">

我已经为我的网站制作了一个联系表单,包括html和php,它确实会发送一封显示“name:email:message:”的电子邮件,但之后它是空的,因此它不会显示您在表单中键入的内容,请帮助

以下是html:

<form action="thankyou.php" method="post">
<div class="col-md-5" style="margin-top:15px;">
        <div class="form-group">
        <label for="contact-name" class="col-sm-2 control-label">Naam</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="contact-name" placeholder="First & Last name" />
            </div>
            </div>
            
            <div class="form-group">
        <label for="contact-email" class="col-sm-2 control-label" style="margin-top:15px;">Email</label>
        <div class="col-sm-10" style="margin-top:15px;">
            <input type="text" class="form-control" id="contact-name" placeholder="example@domain.com" />
            </div>
            </div>
            
            <div class="form-group">
        <label for="contact-message" class="col-sm-2 control-label" style="margin-top:15px;">Message</label>
        <div class="col-sm-10" style="margin-top:15px;">
            <textarea class="form-control" rows="4"></textarea>
            </div>
            </div>
            
            <button style="btn-align:center; margin-left:88px; margin-top:15px;" type="submit" class="btn btn-primary">Verstuur</button>
 
</div>
</div>
    </div>
 </form>

纳姆
电子邮件
消息
维斯图尔
以下是php:

<?
$name = $_POST['contact-name'];
$email = $_POST['contact-email'];
$message = $_POST['contact-message'];

$email_message = "
Name:".$name."
Email:".$email."
Message:".$message." 


";

mail ( "email@example.com" , "New inquiry", $email_message);
?>

您的表单字段都缺少name属性。没有它,数据就不会被发送


^^^^
所有表单字段都缺少此字段

您的表单字段都缺少name属性。没有它,数据就不会被发送


^^^^
所有表单字段都缺少此字段

您的表单字段都缺少name属性。没有它,数据就不会被发送


^^^^
所有表单字段都缺少此字段

您的表单字段都缺少name属性。没有它,数据就不会被发送


^^^^
所有表单字段都缺少此字段
使用此选项并设置为显示潜在错误,在这里会有所帮助。确保短打开标记也已启用。使用此选项并设置为显示潜在错误,在这里会有所帮助。确保短打开标记也已启用。使用此选项并设置为显示潜在错误,在这里会有所帮助。确保短打开标记也已启用。使用此选项并设置为显示潜在错误,在这里会有所帮助。确保短打开标记也已启用。
<input type="text" class="form-control" name="contact-name" id="contact-name" placeholder="First & Last name" />
                                        ^^^^
                                    This is missing for all form fields