我試圖做一個聯繫表,我得到這個通用錯誤:聯繫我們的電子郵件PHP錯誤
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
我無法弄清楚如何得到它實際登錄或回聲錯誤。這是我的PHP文件:
<?php
ini_set('display_errors', true);
ini_set('log_errors', true);
error_reporting(E_ALL);
ini_set('error_log', 'php.log');
$field_fname = $_GET['fname'] ;
$field_lname = $_GET['lname'] ;
$field_bname = $_GET['bname'] ;
$field_email = $_GET['email'] ;
$field_address = $_GET['address'] ;
$field_city = $_GET['city'] ;
$field_state = $_GET['state'] ;
$field_zip = $_GET['zip'] ;
$field_country = $_GET['country'] ;
$field_comments = $_GET['comments'] ;
$mail_to = '[email protected]';
$subject = 'Message from a site visitor '.$field_fname .$field_lname;
$body_message = 'From: '.$field_fname .$field_lname 'at' .$field_bname "\n";
$body_message = 'E-mail: '.$field_email "\n";
$body_message = 'Address:'.$field_address "\n";
$body_message = 'City:'.$field_city "\n";
$body_message = 'State:'.$field_state "\n";
$body_message = 'Zip Code:'.$field_zip "\n";
$body_message = 'Country:'.$field_country "\n";
$body_message = 'Message: '.$field_comments;
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'index.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to [email protected]');
window.location = 'index.html';
</script>
<?php
}
?>
我不知道我在做什麼是錯的。如果有人能夠幫助我找到錯誤或指示我登錄或迴應錯誤,我會非常感激。
感謝
什麼版本的PHP?在5.4之前,你應該做'error_reporting(E_ALL | E_STRICT)'。看到這裏:http://php.net/manual/en/function.error-reporting.php – Raekye 2013-03-21 22:07:31
你也錯過了20號線上的另一個時期,一個21,一個22,一個23,一個24,一個25和26上的一個。 – 2013-03-21 22:12:12