我无法弄清楚我的PHP问题。有PHP代码的人可以吗?

时间:2010-12-23 00:32:57

标签: php web

当我点击提交按钮时,它会给我一个错误页面。这是网站http://nealconstruction.com/estimate.html

<?php
/* Subject and Email Varibles */

    $emailSubject = 'Estimate'
    $webMaster = 'jeffery.neal06@gmail.com'

/* Gathering Info */

 $emailField = $_POST ['email'];
    $nameField = $_POST ['name'];
    $phoneField = $_POST ['phone'];
    $typeField = $_POST ['type'];
    $locationField = $_POST ['location'];
    $infoField = $_POST ['info'];
    $contactField = $_POST ['contact'];

    $body = <<<EOD
<br><hr><br>
Email: $email <br>
Name: $name <br>
Phone Number: $phone <br>
Type Of Job: $type <br>
Location: $location <br>
Additional Info: $info <br>
How to Contact: $contact <br>
EOD;

 $headers = "From: $email\r\n";
    $headers .= "Content-Type: text/html\r\n";
    $success = mail($webMaster; $emailSubject; $body; $headers);

/* Results rendered as html */

 $theResults = <<<EOD
<html>
<head>
<title>JakesWorks - travel made easy-Homepage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
 background-color: #f1f1f1;
 font-family: Verdana, Arial, Helvetica, sans-serif;
 font-size: 12px;
 font-style: normal;
 line-height: normal;
 font-weight: normal;
 color: #666666;
 text-decoration: none;
}
-->
</style>
</head>

<div>
  <div align="left">Thank you for your information! We will contact you very soon!</div>
</div>
</body>
</html>
EOD;

echo "$theResults";

?>

4 个答案:

答案 0 :(得分:2)

之后没有;
$emailSubject = 'Estimate'
$webMaster = 'jeffery.neal06@gmail.com'

;参数之间有mail,应该是,

我建议您配置服务器以显示调试消息。如果您无权更改服务器上的设置,则可以在自己的PC上设置本地服务器以用于开发和测试。对这样的错误没有得到任何有用的反馈可以使开发成为一个活生生的地狱。 :)

答案 1 :(得分:2)

这是你的错误:

$success = mail($webMaster; $emailSubject; $body; $headers);

将其更改为:

$success = mail($webMaster, $emailSubject, $body, $headers);

答案 2 :(得分:0)

我怀疑你的.htaccess文件中可能有错误。这通常是我经历过500次错误的主要原因。

答案 3 :(得分:0)

这可能是服务器问题。联系您的系统管理员或Web服务提供商。他们或许可以解决这个问题。

相关问题