I cant figure out my PHP problem. Can anyone with PHP codes?
when I click the submit button it gives me an error page. Here is the site 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 .= "C开发者_JS百科ontent-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";
?>
There are not ;
after
$emailSubject = 'Estimate'
$webMaster = 'jeffery.neal06@gmail.com'
And there are ;
between the mail
parameters, which should be ,
.
I'd advise you to configure your server that it shows debug messages. If you don't have permission to change settings on the server, you could set up a local server on you own PC to use for developing and testing. Not getting any useful feedback on mistakes like this can make development a living hell. :)
This is your error:
$success = mail($webMaster; $emailSubject; $body; $headers);
Change it to:
$success = mail($webMaster, $emailSubject, $body, $headers);
I suspect you may have an .htaccess file that has an error in it. That is usually the main cause of 500 errors in my experience.
This may be a server issue. Contact your system admin or web service provider. They may be able to resolve the issue.
精彩评论