I have no clue how to email myself an array of selections from the user. Here is what I have and the only thing not working is the multiple select name="products[]"
what I have:
// check if the form was posted
if ($submit != "") {
$errmsg="";
// validate the fields
if ($fname=="") $errmsg.=" First Name";
if ($lname=="") $errmsg.=" Last Name";
if ($title=="") $errmsg.=" Title";
if ($company=="") $errmsg.=" Company";
if ($division=="") $errmsg.=" Division";
if ($org_type=="") $errmsg.=" Org Type";
if ($email=="") $errmsg.=" Email";
if ($address=="") $errmsg.=" Address";
if ($city=="") $errmsg.=" City";
if ($state=="") $errmsg.=" State";
if ($zip=="") $errmsg.=" ZipCode";
if ($country=="") $errmsg.=" Country";
if ($phone=="") $errmsg.=" Phone";
//return the answer for the email notification
if ($opt_email_update=="") {
$opt_mail="No";
} else {
$opt_mail="Yes";
}
//this is where code would go for the product array
// empty $errmsg means validation passed
if ($errmsg==""){
// email the results to yourself.
$msg = "Company:\t $company\n";
$msg .= "Name:\t $fname $lname\n";
$msg .= "Title:\t $title\n";
$msg .= "Division:\t $division\n";
$msg .= "Org Type:\t $org_type\n";
$msg .= "\nPhone:\t $phone\n";
$msg .= "Fax:\t $opt_fax\n";
$msg .= "eMail:\t $email\n";
$msg .= "\nAddress:\n$address\n";
$msg .= "Address2:\t$opt_address\n";
$msg .= "$city, $state $zip\n";
$msg .= "Country:\t$country\n";
$msg .= "\nProducts:\n$products\n";
$msg .= "\nComments:\t$opt_comments\n";
$msg .= "Referral:\t$visit_reason\n";
$msg .= "Opt Mail List:\t$opt_mail\n";
$recipient = "me@mydomain.com";
$subject = "Information Request";
$mailheaders = "From: $company <> \n";
$mailheaders .= "Reply-To: $email\n\n";
mail($recipient, $subject, $msg, $mailheaders);
}
Thanks in advance for any help. I am brand spanking new to arrays.