Buenos días
 
quisiera saber como puedo hacer para insertar los campos generados desde un ciclo el codigo que manejo es el siguiente  
 Código PHP:
   
<form id="frm_validar" name="frm_validar" method="post" action="prueba1.php">
  <table width="519" border="0" align="center">
    <tr>
      <td>Nombre</td>
      <td>Apellido</td>
      <td>Telefono</td>
    </tr>
<?php
for($i=0; $i<=3; $i++)
{
?>
    <tr>
      <td>
      <input type="text" name="<?php echo "codigo_producto".$i?>" id="<?php echo "codigo_producto".$i?>" value="<?php echo $i?>"/>
      <input type="text" name="<?php echo "txt_nombre".$i?>" id="<?php echo "txt_nombre".$i?>" class="required" /></td>
      <td>
      <input type="text" name="<?php echo "txt_apellido".$i?>" id="<?php echo "txt_apellido".$i?>" /></td>
      <td>
      <input type="text" name="<?php echo "txt_telefono".$i?>" id="<?php echo "txt_telefono".$i?>" /></td>
    </tr>
 <?php    
}
?>
  </table>
  <div align="center">
    <input type="submit" name="btn_guardar" id="btn_guardar" value="Guardar" />
  </div>
</form>