Page 1 of 1

simple syntax error?

Posted: Mon May 11, 2009 5:29 am
by killamike553
Hey everyone, I am a complete noob to php and i was try to create a simple email form php but i keep getting the follow error...."Parse error: syntax error, unexpected $end in /home/content/c/r/m/crmedia/html/scripts/contactprocess.php on line 68"
this is the page http://www.sweetrubie.com/Contact.html and the php coding. any help would be greatly appreciated.
 

Code: Select all

<?php
/* Subject and Email Variables */
 
    $emailSubject = ' Form process';
    $webMaster = 'mikearodriguez@comcast.net';
    
/* Gathering Data Variables */
    $nameField = $_POST['name'];
    $emailField = $_POST['email'];
    $cityField = $_POST['city'];
    $phoneField = $_POST['phone'];
    $companyField = $_POST['company'];
    $jobField = $_POST['job'];
    $timeField = $_POST['time'];
    $monthField = $_POST['month'];
    $dayField = $_POST['day'];
    $forField = $_POST['for'];
    $locationField = $_POST['location'];
    $verifiedField = $_POST['verified'];
    $memberField = $_POST['member'];
    $agencyField = $_POST['agency'];
    $commentsField = $_POST['comments'];
    
    $body = <<<EOD
<br><hr><br>
Email: $emailField <br>
Name: $nameField <br>
Phone number: $phoneField <br>
Comments: $commentsField <br>
EOD;
    $headers = "From: $emailField\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 interest! Your email will be answered very soon!</div></div>
 
 
</body>
</html>
EOD;    
echo "$theResults";     
 
 
?>
 

Re: simple syntax error?

Posted: Mon May 11, 2009 5:43 am
by Defiline
There must not be any space before EOD;

Read PHP manual:
http://ee.php.net/language.types.string

Re: simple syntax error?

Posted: Mon May 11, 2009 5:56 am
by killamike553
sorry forgot to put in php form, there is no space before EOD and the error says line 68 which has nothing but "?>" and thanks for the link :)