*Parse error*: syntax error, unexpected $end in *
/home/a9066165/public_html/admin/processccu.php* on line *231*

I did some major code rewriting about halfway through (lines 114-132), and
suddenly I'm getting the above ERROR. I have examined the code line by line,
but I'm still relatively new to this, and I don't even know what to look
for!

Here is the complete code, from beginning <?php tag to closing </html> tag:

<?php_track_vars?>
<?php

//CHECKS TO SEE IF FIELDS WERE PROPERLY COMPLETED AND ASSIGNS VARIABLES TO
INPUTS - OTHERWISE AN ERROR MESSAGE IS PRINTED
$Employee = $_POST['Employee'];
if(!empty($_POST['FirstName'])) {
 $FirstName = $_POST['FirstName'];
 } else {
 print "<p class='error'>You have not entered the customer's <b>First
Name</b>, please go back and enter it now.</p>";
 }

if(!empty($_POST['LastName'])) {
 $LastName = $_POST['LastName'];
 } else {
 print "<p class='error'>You have not entered the customer's <b>Last
Name</b>, please go back and enter it now.</p>";
 }
if(!empty($_POST['EMailAddress'])) {
 $EMailAddress = $_POST['EMailAddress'];
 } else {
 $EMailAddress = " ";
if(!empty($_POST['Address1'])) {
 $Address1 = $_POST['Address1'];
 } else {
 print "<p class='error'>You must supply the customer's <b>First Address
Line</b>, please go back and enter it now.</p>";
 }
if(!empty($_POST['Address2'])) {
 $Address2 = $_POST['Address2'];
 } else {
 $Address2 = " ";
 }
if(!empty($_POST['City'])) {
 $City = $_POST['City'];
 } else {
 print "<p class='error'>You have not entered the customer's <b>City<b>,
please go back and enter it now.</p>";
 }
if(!empty($_POST['IsHandicappedAccommodations'])) {
 $IsHandicappedAccommodations = "YES";
 } else {
 $IsHandicappedAccommodations = "NO";
 }
if(!empty($_POST['State'])) {
 $State = $_POST['State'];
 } else {
 print "<p class='error'>You have not entered the customer's <b>State</b>,
please go back and enter it now.</p>";
 }
if(!empty($_POST['ZIP'])) {
 $ZIP = $_POST['ZIP'];
 } else {
 print "<p class='error'>You have not entered the customer's <b>ZIP
Code</b>, please go back and enter it now.</p>";
 }
if(!empty($_POST['IsSenior'])) {
 $IsSenior = "YES";
 } else {
 $IsSenior = "NO";
 }
if(!empty($_POST['DaytimeTelephone'])) {
 $DaytimeTelephone = $_POST['DaytimeTelephone'];
 } else {
 print "<p class='error'>You have not entered the customer's <b>Daytime
Telephone Number</b>, please go back and enter it now.</p>";
 }

$_POST['Category1'] = $Category1;
$_POST['Category2'] = $Category2;
$_POST['Category3'] = $Category3;
$_POST['Category4'] = $Category4;
$_POST['Category5'] = $Category5;
$_POST['Category6'] = $Category6;
$select = "Select";

if($Category1 == $select && $Category2 == $select && $Category3 == $select
&& $Category4 == $select && $Category5 == $select && $Category6 == $select)
{
 print "<p class='error'>You must choose at least one <b>Category</b>!</p>";
 }

$categoryarray = array($Category1, $Category2, $Category3, $Category4,
$Category5, $Category6);
foreach ($categoryarray as $c) {
 if ($c == $select) {
  $c = " ";
 }
}

//REPLACES NAME VALUES WITH USER-FRIENDLY STRINGS
$fields = array();
$fields{"EMailAddress"} = "Email Address";
$fields{"FirstName"} = "First Name";
$fields{"LastName"} = "Last Name";
$fields{"DaytimeTelephone"} = "Home Phone";
$fields{"Address1"} = "Address Line 1";
$fields{"Address2"} = "Address Line 2";
$fields{"City"} = "City";
$fields{"State"} = "State";
$fields{"ZIP"} = "Postal Code";
$fields2 = array();
$fields2{"Employee"} = "Employee";
$fields2{"IsHandicappedAccommodations"} = "Needs Handicap Accommodations";
$fields2{"IsSenior"} = "Senior Status";
$fields2{"Category1"} = "Email Category 1";
$fields2{"Category2"} = "Email Category 2";
$fields2{"Category3"} = "Email Category 3";
$fields2{"Category4"} = "Email Category 4";
$fields2{"Category5"} = "Email Category 5";
$fields2{"Category6"} = "Email Category 6";
//SETS VARIABLES TO BE USED FOR EMAIL
$to = "market...@cityoflancasterca.org";
$subject = "Constant Contact Update Form";
$headers = "From: $Employee\nMIME-Version: 1.0\nContent-type:
text/html\ncharset: iso-8859-1";
$body = "We have received the following
information:\n\n<html>\n<body>\n<table cellspacing='2' cellpadding='2'
border='1'>\n<tr valign='top'>\n";
//FOREACH LOOP
$format = "%s\t";
$headerlabel = '0';
foreach ($fields as $x => $y) {
 $headerlabel = $headerlabel +1;
 $body .= "<td>{$headerlabel}<br>\n<img src='
http://lpacmarketing.hostzi.com/images/spacer.gif' width='120'
height='1'></td>\n";
}

$body .= "</tr>\n<tr valign='top'>\n";
foreach ($fields2 as $x => $y) {
 $body .= "<td>{$y}</td>\n";
}
$body .= "</tr>\n<tr valign='top'>\n";
foreach ($categoryarray as $d) {
 $body .= "<td>{$d}</td>\n";
}

$body .= "</tr>\n<tr valign='top'>\n<td colspan='9'><pre>\n";

foreach ($fields as $a => $b) {
 $body .= sprintf($format, $b);
}
$body .= "<br>";

foreach ($fields as $a => $b) {
 $body .= sprintf($format, $_POST[$a]);
}
$body .= "</pre></td>\n</tr>\n</table>\n</body>\n</html>";
//END FOREACH LOOPS

//SETS VARIABLES TO BE USED FOR THANK-YOU EMAIL

$send = mail($to, $subject, $body, $headers);

//test escape character on URL
if($send) {header("Location: http:/\/
lpacmarketing.hostzi.com/admin/processccu.php");
} else {
 print "<p class='error'>We encountered an error submitting your survey!
Please notify 
market...@cityoflancasterca.org.</p<market...@cityoflancasterca.org.%3c/p>
>";
 }
?>
<BR><BR></DIV>
  <BR></DIV></TD>
 </TR>
</TABLE>
 </DIV>
<BR><BR><BR><BR><BR><BR>
</body>
</html>

Reply via email to