我已经开始在网站上使用php电子邮件表单,我不确定它是代码或其他内容中的某些内容,但我一直在获取内部服务器错误,当我测试它们时显示线上。php电子邮件形式内部服务器错误
以下是以php和html代码为例。
HTML
<form action="form.php" method="post" name="Contact form">
<p>First Name:
<input name="first_name" type="text" />
</p>
<p>
Last Name:
<input name="last_name" type="text" />
</p>
<p>
Email:
<input name="email" type="text" />
</p>
<p>
Message:
<textarea name="message" id="textarea" cols="30" rows="5"></textarea>
</p>
<p>
<input type="submit" name="Submit" id="Submit" value="Submit" />
<input type="reset" name="reset" id="reset" value="Reset" />
</p>
</form>
PHP
<?php
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$first_name = $_POST['email'];
$first_name = $_POST['message'];
$to = "[email protected]";
$subject = "New Message";
mail ($to, $subject, $message, "From:" . $first_name . $last_name);
echo "Your message has been sent";
?>
这是错误消息
内部服务器错误
服务器遇到一个内部错误或配置错误,无法完成您的请求。
请与服务器管理员webmaster @ localhost联系,并告知他们发生错误的时间以及您可能已经造成错误的任何事情。
有关此错误的更多信息可能在服务器错误日志中可用。
的Apache/2.2.3(CentOS的)服务器在justjoel.co.uk端口80
检查您的'error_log'并张贴哟你的问题你的错误。 – NobleUplift 2014-10-30 17:23:20
你应该检查你的托管服务提供商 – 2014-10-30 19:14:42
可能重复的[PHP邮件表单不能完成发送电子邮件](http://stackoverflow.com/questions/24644436/php-mail-form-doesnt-complete-sending-电子邮件) – 2014-10-30 19:18:43