无法使用[]来读取HTTP500错误

时间:2016-05-05 13:20:12

标签: php http

我使用此代码收到http500错误:

<?php
if(isset($_POST['submit'])){
    $to = ["charlestdjames1@gmail.com"];
    $subject = $_POST["name"];
    $message = $_POST["content"];
    $headers = $_POST["email"];

    mail($to, $subject, $message, $headers);
}   
?>

日志表明我无法使用[]进行阅读,我不确定这是否是代码错误。

我正在使用的表单:

<form method="post">
            <span class="close">x</span>
            <label class="modalFont" for="name">Name:</label>
            <input class="modalFont" type="text" id="name" name="name" placeholder="Please enter your name" /><br />
            <label class="modalFont" for="email">Email Address:</label>
            <input class="modalFont" type="text" id="email" name="email" placeholder="Please enter your email" /><br />
            <label class="modalFont" for="message">Message:</label>
            <input class="modalFont" type="text" id="message" name="content" placeholder="Enter your message here" /><br />

            <button type="submit" id="submit">Submit</button>
 </form>

0 个答案:

没有答案