I need to make sure that either the text was entered into the form’s textarea input element or a file attached through the file input element.
I tried various things, including this:
if((empty($_POST['text'])) && (!empty($_FILES['uploadedfile']))) {
$errors .= 'Please either enter your text or attach a file.<br/><br/>';
}
Doesn’t work.
Thank you!
Try
You only want one OR the other so you ask if the "text" field is empty OR the "uploadFile" is empty