Parse error: syntax error, unexpected T_ELSE in /Volumes/Data/www/Intrepid/TonySweet/website/mailer2.php on line 39
I take it this has something to do with { and }...
<?php
if(isset($_POST['submit'])) {
$to = "example@example.com";
$subject = "Registration Form";
$name_field = $_POST['name'];
$phone_field = $_POST['phone'];
$cell_field = $_POST['cell'];
$email_field = $_POST['email'];
$website_field= $_POST['website'];
$address_field = $_POST['address'];
$city_state_zip_field = $_POST['city_state_zip'];
$multiple = $_POST['multiple[]'];
$dropdown = $_POST['drop_down'];
$dropdown2 = $_POST['drop_down2'];
$referred_field = $_POST['referred'];
$emer_contact_field = $_POST['emer_contact'];
$relation_field = $_POST['relation'];
$emer_home_field = $_POST['emer_home'];
$emer_cell_field = $_POST['emer_cell'];
$equipment_field = $_POST['equipment'];
$cc_name_field = $_POST['ccname'];
$date_field = $_POST['date'];
$option = $_POST['radio'];
$option2 = $_POST['radio2'];
$message_field = $_POST['message'];
foreach($_POST['multiple'] as $value)
$key .= "$value\n";
}
$body = "Name: $name_field\n Home Phone: $phone_field\n Cell Phone: $cell_field\n E-Mail: $email_field\n Website: $website_field\n Address: $address_field\n City,State,Zip: $city_state_zip_field\n Workshop: $key Photography Level: $dropdown\n Photography Interest: $dropdown2\n Referral: $referred_field\n Emergency Contact: $emer_contact_field\n Relation: $relation_field\n Home: $emer_home_field\n Cell: $emer_cell_field\n Equipment: $equipment_field\n Agreed: $cc_name_field\n Date: $date_field\n Option: $option\n Method: $option2\n Message:\n $message_field\n";
{ echo "Your registration has been submitted to $to!
You will receive an email confirmation shortly.";
} mail($to, $subject, $body);
{ else
echo "Data was not sent!";
}
?>