Hi there,
Can someone help out?
This code keeps yielding a Parse error: parse error, unexpected '\"' error message, and for the life of me, I can't find the problem. Here's a snippet of the problematic code:
if ($fn && $ln && $e && $ad1 && $pn) {
$sendTo = "abc@xyz.com";
$subject = "Registration";
$headers = "From: " . $_POST["fullname"] ."<" . $_POST["email"] . ">\r\n";
$headers .= "Cc: def@xyz.com" . "\r\n";
$headers .= "Bcc: ghi@xyz.com" . "\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-path: " . $_POST["email"];
$message = "
CONTACT INFORMATION
-----------------------------------
Registrant Name: $fn $ln
Address: $ad1
Email: $e
Phone Number: $pn
Fax Number: $fx
Dinner Requirements: $drq
Comments: $cm
";
if ($_POST['regtype'] == 'Golf') {
$message .= "
GOLF REGISTRATION
-----------------------------------
1) Will registrant stay for cocktails, silent and live auction and dinner? $go1
2) Player handicap: $go2
3) Player shirt size: $go3
4) Foursome? $go4
";
} else {
$message .= "
GOLF REGISTRATION
-----------------------------------
Registrant will not participate in Golf Tournament";
}
if ($_POST['golf_o4'] == 'Yes') {
$message .= "
Golfer 2 Information
Name: $go1p2
Email: $go2p2
Handicap: $go3p2
Shirt Size: $go4p2
Golfer 3 Information
Name: $go1p3
Email: $go2p3
Handicap: $go3p3
Shirt Size: $go4p4
Golfer 4 Information
Name: $go1p4
Email: $go2p4
Handicap: $go3p4
Shirt Size: $go4p4
} else {
$message .= ""; // THIS IS LINE 390
}
if ($_POST['regtype'] == 'Tennis') {
$message .= "
TENNIS REGISTRATION
-----------------------------------
1) Will registrant stay for cocktails, silent and live auction, and dinner? $tn1
2) Tennis Level - $tn2
3) Shirt Size - $tn3
4) Guest Name - $tn1p2
5) Guest Email - $tn2p2
6) Guest Tennis Level - $tn3p2
7) Guest Shirt Size - $tn4p2
";
} else {
$message .= "
TENNIS REGISTRATION
----------------------------------
Registrant will not be participating in Tennis Tournament";
}
if ($_POST['regtype'] == 'Yes') {
$message .= "
DINNER ONLY
-----------------------------------
Will registrant be bringing one or more guests? $din1
Names of additional guest(s)
1) $dinn1
2) $dinn2
3) $dinn3
4) $dinn4
5) $dinn5
6) $dinn6
7) $dinn7
8) $dinn8
9) $dinn9
10) $dinn10
";
} else {
$message .= "
DINNER ONLY
-----------------------------------
Registrant will not be participant in Dinner Only
";
}
mail($sendTo, $subject, $message, $headers);
echo '<p>Your registration form has been successfully submitted. An email has been sent to you confirming the
information.</p>';
} else {
echo '<p><font color="red">Form could not be processed due to a system error</font></p>';
}