simple syntax error?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
killamike553
Forum Newbie
Posts: 2
Joined: Mon May 11, 2009 5:19 am

simple syntax error?

Post 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";     
 
 
?>
 
Last edited by killamike553 on Mon May 11, 2009 5:57 am, edited 2 times in total.
Defiline
Forum Commoner
Posts: 59
Joined: Tue May 05, 2009 5:34 pm

Re: simple syntax error?

Post by Defiline »

There must not be any space before EOD;

Read PHP manual:
http://ee.php.net/language.types.string
killamike553
Forum Newbie
Posts: 2
Joined: Mon May 11, 2009 5:19 am

Re: simple syntax error?

Post 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 :)
Post Reply