HELP - Parse Error
am 04.08.2009 19:47:40 von Allen McCabe--0016368324ea9ec7ab0470547b7c
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
*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 tag:
//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 "
You have not entered the customer's First
Name, please go back and enter it now.
}
if(!empty($_POST['LastName'])) {
$LastName = $_POST['LastName'];
} else {
print "
You have not entered the customer's Last
Name, please go back and enter it now.
}
if(!empty($_POST['EMailAddress'])) {
$EMailAddress = $_POST['EMailAddress'];
} else {
$EMailAddress = " ";
if(!empty($_POST['Address1'])) {
$Address1 = $_POST['Address1'];
} else {
print "
You must supply the customer's First Address
Line, please go back and enter it now.
}
if(!empty($_POST['Address2'])) {
$Address2 = $_POST['Address2'];
} else {
$Address2 = " ";
}
if(!empty($_POST['City'])) {
$City = $_POST['City'];
} else {
print "
You have not entered the customer's City,
please go back and enter it now.
}
if(!empty($_POST['IsHandicappedAccommodations'])) {
$IsHandicappedAccommodations = "YES";
} else {
$IsHandicappedAccommodations = "NO";
}
if(!empty($_POST['State'])) {
$State = $_POST['State'];
} else {
print "
You have not entered the customer's State,
please go back and enter it now.
}
if(!empty($_POST['ZIP'])) {
$ZIP = $_POST['ZIP'];
} else {
print "
You have not entered the customer's ZIP
Code, please go back and enter it now.
}
if(!empty($_POST['IsSenior'])) {
$IsSenior = "YES";
} else {
$IsSenior = "NO";
}
if(!empty($_POST['DaytimeTelephone'])) {
$DaytimeTelephone = $_POST['DaytimeTelephone'];
} else {
print "
You have not entered the customer's Daytime
Telephone Number, please go back and enter it now.
}
$_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 "
You must choose at least one Category!
";}
$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 = "marketing@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\n\n
//FOREACH LOOP
$format = "%s\t";
$headerlabel = '0';
foreach ($fields as $x => $y) {
$headerlabel = $headerlabel +1;
$body .= "
\n

}
$body .= "
foreach ($fields2 as $x => $y) {
$body .= "
}
$body .= "
foreach ($categoryarray as $d) {
$body .= "
}
$body .= "
\n";
foreach ($fields as $a => $b) {
$body .= sprintf($format, $b);
}
$body .= "
";
foreach ($fields as $a => $b) {
$body .= sprintf($format, $_POST[$a]);
}
$body .= "
//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 "
We encountered an error submitting your survey!
Please notify marketing@cityoflancasterca.org.
>";
}
?>