ok scratch that, I figured it out, along with a few other errors.
Now the issue is:
Warning: Invalid argument supplied for foreach() in /Volumes/Data/www/Intrepid/TonySweet/website/mailer2.php on line 25
Data has been submitted to example@example.com!
<?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'];
$address_field = $_POST['address'];
$city_state_zip_field = $_POST['city_state_zip'];
$location_workshops_field = $_POST['multiple'];
$photography_level_field = $_POST['drop_down'];
$kind_of_photography_field = $_POST['drop_down'];
$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['CC_name'];
$date_field = $_POST['date'];
$message_field = $_POST['message'];
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value\n";
}
$body = "Name: $name_field\n Home Phone: $phone_field\n Cell Phone: $cell_field\n E-Mail: $email_field\n Address: $address_field\n City,State,Zip: $city_state_zip_field\n Workshop: $multiple\n Photography Level: $dropdown\n Photography Interest: $dropdown\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 Message:\n $message_field\n";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "Data was not sent!";
}
?>
I assume this has something to do with the drop-down and multiple options I'm not sure how to code. I'm receiving an email with the field names, but only the data from 3 or 4 of the fields even when they are all completed on the form.
Any help would be appreciated! Thanks!