Hi,
I just can't get my head around the logic I need to perform this process.
I have a form where the user can select one of two items, simple.
item1 = a
item2 = b
When the form is submitted the POST vars "item1" and "item2" sent to another script.
I need to be able to trap an error if neither of the items is selected.
I.E: if item1 is selected, process, or if item2 is selected, proccess but if none were selected display an error.
The way I have been attacking it is:
if(empty($POST['item1) || (empty($POST['item2))){
$Error = "Error";
} else {
// do something
}
I know this logic is completely wrong. How best should this be done.