Good evening, according to my understanding, your doubt can be solved with JavaScript, more precisely jQuery ..
If in PHP, you want PHP to write the form, do more or less like this using for () :
form.php
<?php
$numCampos = $_GET["num_campos"];
echo '<form method="POST">
<!-- Dados repetidos --!>
';
for($i = 0; $i < $numCampos; $i++) {
echo '<label for="amox_'.$i.'">Amox '.($i+1).'</label> <input type="text" name="amox[]" id="amox_'.$i.'"><br />
';
}
echo '</form>';
?>
And in the browser you access: link
And it will return:
<form method="POST">
<!-- Dados repetidos -->
<label for="amox_0">Amox 1</label> <input name="amox[]" id="amox_0" type="text"><br>
<label for="amox_1">Amox 2</label> <input name="amox[]" id="amox_1" type="text"><br>
<label for="amox_2">Amox 3</label> <input name="amox[]" id="amox_2" type="text"><br>
<label for="amox_3">Amox 4</label> <input name="amox[]" id="amox_3" type="text"><br>
</form>
Or you can do in jQuery that will be much more dynamic and visually beautiful for the user, using jQuery.append () .
I hope I have helped.