Checkbox input information in an email

bbkzcyduxy

New Member
I have some code that displays input information from a checkbox in my email once submitted. This works absolutely fine but when a user does not make a selection from the checkboxes I want it to display 'No options checked' in my email message. How can I do this? Below is the relevant code - I need to achieve this for both of these checkboxes. I am assuming I need some sort of ELSE statement.Code:\[code\]if(!empty($_POST['features'])) {foreach($_POST['features'] as $value) { $check_msg1 .= "Features checked: ".$value."\n"; }}if(!empty($_POST['fright'])) {foreach($_POST['fright'] as $value) { $check_msg2 .= "Fright checked: ".$value."\n"; }}\[/code\]
 
Back
Top