I have a form in HTML and a code in PHP. The form contains a lot of different <input>
things. And I want some text to output in a browser only if all the fields are not empty.
For example, for two fields called name
and age
, I would do the following:
if($_POST['name'] and $_POST['age']) { ... }
But here I have much more than two fields. What should I do?