我使用此代码收到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>