0
I know how to do this by if Else, but I have 8 fields where you can only have 1,2,3... blank fields and I have to check if the field is empty and if you are not updating in DB, I wanted to know if there is easier way.
<form action="alteraroficioC1.php" method="post" enctype="multipart/form-data">
<tr><th>Nº</th><td><?php echo $idget ?></td><td>Alterar para: </td><td></td></tr>
<tr><th>Data</th><td><?php echo $dataof ?></td><td><input type="input" name="data" id="<?php echo $idInput; ?>" onkeyup="mascaraData(<?php echo $idInput; ?>);" maxlength="10" placeholder="dd/mm/aaaa" /></td><td><input type="image" src="../images/save_01_16x16.png" name="id" value="<?php echo $manid; ?>"></td></tr>
<tr><th>Solicitado por</th><td><?php echo $solicitado ?></td><td><input type="text" name="nomePor" </td><td><input type="image" src="../images/save_01_16x16.png" name="id" value="<?php echo $manid; ?>"></td></tr>
<tr><th>Destino/Unidade</th><td><?php echo $destino ?></td><td><input type="text" name="nomePor" </td><td><input type="image" src="../images/save_01_16x16.png" name="id" value="<?php echo $manid; ?>"></td></tr>
<tr><th>Setor</th><td><?php echo $setor ?></td><td><input type="text" name="nomePor" </td><td><input type="image" src="../images/save_01_16x16.png" name="id" value="<?php echo $manid; ?>"></td></tr>
<tr><th>Para/Pessoa</th><td><?php echo $nomepara ?></td><td><input type="text" name="nomePor" </td><td><input type="image" src="../images/save_01_16x16.png" name="id" value="<?php echo $manid; ?>"></td></tr></tr>
<tr><th>Nome</th><td><?php echo $nome ?></td><td><input type="text" name="nomePor" </td><td><input type="image" src="../images/save_01_16x16.png" name="id" value="<?php echo $manid; ?>"></td></tr></tr>
<tr><th>Assunto</th><td><?php echo $assunto ?></td><td><input type="text" name="nomePor" </td><td><input type="image" src="../images/save_01_16x16.png" name="id" value="<?php echo $manid; ?>"></td></tr></tr>
<input type="hidden" name="idd" value="<?php echo $idget; ?>"/> <? // para redirect()?>
</form>
Gives an example of code in the question, is an array or variables 'loose'?
– rray
I’ve set examples, but I’ve come up with a solution to my problem, thank you.
– Guerric Inse
I already solved the problem using the default html resource.
– Guerric Inse
Used the
require
?– rray
Did any of the answers solve your problem? In that case you can mark as accepted. Or you can give me an answer like you did but explain how you solved the problem. Just as this is too short to be an answer and won’t help others who might have the same problem.
– Sergio