When I hit my submit button I get an error on the reply page
Notice: Undefined variable: check_msg in E:\clients\ddr emp\mailer.php on line 18
the link: http://dev-rockwood.virtualhorizons.com/about.htm#
click on the download catalog link on the right
Why am I getting this error?
<?php
if(isset($_POST['submit'])) {
$to = "[EMAIL="dhowe@virtualhorizons.com"]dhowe@virtualhorizons.com[/EMAIL]";
$subject = "Request for Catalog";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$address_field = $_POST['address'];
$city_field = $_POST['city'];
$state_field = $_POST['state'];
$zip_field = $_POST['zip'];
$phone_field = $_POST['phone'];
$catalog_field = $_POST['catalog'];
$message = $_POST['comments'];
foreach($_POST['check'] as $value) {
$check_msg .= "Wanting to Purchase: $value
";
}
$body = "From: $name_field
E-Mail: $email_field
Address: $address_field
City: $city_field
State: $state_field
Zip: $zip_field
Phone: $phone_field
Catalog Option: $catalog_field
$check_msg Message:
$message
";
if($catalog_field == "9mb"){
print("Thank You $name_field for requesting our catalog.");
} else if($catalog_field =="1mb") {
print("Thank You $name_field for requesting our catalog.");
}else{
echo "nothing";
}
mail($to, $subject, $body);
} else {
echo "Ahrggg!";
}
?>