PHP正在发送一个空白表单

PHP正在发送一个空白表单,php,html,forms,Php,Html,Forms,我对PHP是全新的,所以我确信我遗漏了一些简单的东西。下面是我网站上的表单和用于抓取的PHP代码,它将正确的格式发送到我的电子邮件,但所有输入都是空的 <form action="backyard/php/contact-form.php" id="contactForm" type="post"> <div class="row"> <d

我对PHP是全新的,所以我确信我遗漏了一些简单的东西。下面是我网站上的表单和用于抓取的PHP代码,它将正确的格式发送到我的电子邮件,但所有输入都是空的

<form action="backyard/php/contact-form.php" id="contactForm" type="post">
                                <div class="row">
                                <div class="form-group">
                                    <div class="col-md-6">
                                        <div class="input-group">
                                    <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
                                    </span>
                                        <input type="text" value="" data-msg-required="Please enter your name." maxlength="100" class="form-control" name="company" id="company" placeholder="Your Name">
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="input-group">
                                      <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-map-marker" aria-hidden="true"></span>
                                    </span>
                                        <input type="text" value="" data-msg-required="Please enter your address." maxlength="100" class="form-control" name="name" id="name" placeholder="Enter Street Address, City, and Zip" required>
                                        </div>
                                    </div>

                                </div>
                            </div>
                            <div class="row">
                                    <div class="col-md-12">
                                         <div class="input-group">
                                     <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
                                    </span>
                                        <input type="email" value="" data-msg-required="Please enter your email address." data-msg-email="Please enter a valid email address." maxlength="100" class="form-control" name="email" id="email" placeholder="Email" required>
                                             <div class="input-group">
                                    </div>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-12">
                                    <input type="submit" value="GET YOUR FREE REPORT" class="btn btn-primary btn-lg" data-loading-text="Loading...">
                                </div>
                            </div>
                        </form>

PHP:

<?php
$email = $_post['email'] ;
$name = $_post['name'] ;
$company = $_post['company'] ;

    /* Set e-mail recipients */
    $to = 'codyg@calculatedservices.ca';

    // subject
    $subject = "Message from " .$name. " - Calculated | Contact form";

    // html message
    $body = '
    <html>
        <head>
            <style type="text/css">
                body
                {
                    font-family:sans-serif;
                }
                p
                {
                    font-size:16px;
                    color:rgb(12,12,12);
                }
                h1
                {
                    font-size:16px;
                    color:rgb(0,64,102);
                }
                .bg-color
                {
                    background: rgb(245,245,245);
                    border-radius:8px;
                }
                .bg-color2
                {
                    background:rgb(0,64,102);
                    color:white;font-size:16px;
                    border-radius:8px;
                }
            </style>
        </head>
        <body>
            <table class="bg-color" border="0" cellspacing="0" cellpadding="8px" width="480" align="center">
                <tr>
                    <td style="background:rgb(0,64,102);border-radius:8px;color:white;">
                        HELLO CALCULATED SERVICES
                    </td>
                </tr>
                <tr>
                    <td>

                    </td>
                </tr>
                <tr>
                    <td height="48" width="100%">
                        <p style="margin-top:20px;">Thank you from:</p>
                        <h1>'.$user_name.'</h1>
                    </td>
                </tr>
                <tr>
                    <td class="bg-color2">
                        Company: <b>'.$company.'</b><br>
                        Name: <b>'.$name.'</b><br>
                        Email: <b>'.$email.'</b><br>
                    </td>
                </tr>
            </table>
        </body>
    </html>
    ';
    // To send HTML mail, the Content-type header must be set
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    // Additional headers
    $headers .= "From: " .$email. "\r\n";

    // MAIL IT!
    $success = mail($to, $subject, $body, $headers);
    if($success) 
    {
        $arrResult = array ('response'=>'success');
    } 
    else
    {
        $arrResult = array ('response'=>'error');
    }
    header ("location: http://www.lestwarog.com")

您是否使用相同的脚本显示表单并发送电子邮件?将表单“type”更改为“method”。版主链接到其他问题和答案,这些问题和答案并没有回答Cody在代码中遇到的非常简单的问题。将类型更改为method但没有效果,仍然向我发送格式正确的电子邮件,但没有从表单中获取信息。$\u POST区分大小写。直到刚才我才注意到$_post将不起作用,而$u post将起作用。