The code below is part of my adapted action.php from the forms tutorial
My form has a multiselect listbox hence the @implode. I do not want the submit or Comments field emailed to me (basically because if there is a comment $mailto gets changed to my support address) The names are correct on the form but I still get the comments so I guess the if statement is wrong. New to PHP so greatful for any help!
$mailto = "feedback@no925.info";
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
if ($key != "submit" && $key != "Comments") {
if (is_array($val)) {
@$val = @implode(", ",$val);
}
$mailbody .= "$key: $val\n";
}
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
My form has a multiselect listbox hence the @implode. I do not want the submit or Comments field emailed to me (basically because if there is a comment $mailto gets changed to my support address) The names are correct on the form but I still get the comments so I guess the if statement is wrong. New to PHP so greatful for any help!
$mailto = "feedback@no925.info";
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
if ($key != "submit" && $key != "Comments") {
if (is_array($val)) {
@$val = @implode(", ",$val);
}
$mailbody .= "$key: $val\n";
}
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
Comment