3
Good morning,
I have to check that all the form fields, sent as $_POST, were not blank, this until I solved. But I wanted to see a way to not need to use too many if/Elif to check every $_POST index would:
if(empty($_POST['nome'])){?>
<p>Campo NOME em branco</p>
<?php}
elif(empty($_POST['cpf'])){?>
<p>Campo CPF em branco</p>
<?php}
elif(empty($_POST['endereco'])){?>
<p>Campo ENDERECO em branco</p>
<?php}
...
else{
$nome = $_POST['nome'];
$cpf = $_POST['cpf'];
$endereco = $_POST['endereco'];
?>
I tried to only use if(Empty($_POST)) but it didn’t work, I let it pass even with the blank fields.
Thank you! It will be very useful to me!
– Rafael Figueiredo