Mi formulario insert.php
Código PHP:
<?
$hijos=1;
$count=$_GET[hijos];
echo $count;
?>
<form name="inserthijos" action="hijosinserta.php" method="post">
<table style="text-align: left; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td>Nombre</td>
<td>Fecha de nacimiento</td>
<td>Sexo</td>
</tr>
<?
while ($hijos<=$count)
{ echo '
<td><input name="TXThijonombre[]" type="text"/></td>
<td><input type="text" name="TXTfecnac[]"/></td>
<td><select name="LSTsexo[]">
<option value="0">Femenino</option>
<option value="1">Masculino</option>
</select>
</td>
</tr>';
$hijos++;
}
?>
</tbody>
</table>
<p align="center"><input type="submit" name="enviar" value="Agregar hijos"/></p>
</form>
y mi process hijosinserta.php
Código PHP:
<?
$hijo=$_POST[TXThijonombre];
$nac=$_POST[TXTfecnac];
$sexo=$_POST[LSTsexo];
$fec=array($hijo,$nac,$sexo);
foreach ($fec as $value){
$val=implode(",",$value);
echo $val[0];
}
?>
he probado asi y cool, me despliega los datos del primer array pero igual me los despliega juntos!
por ejemplo:
Manuel Lopez1989-09-071
Muchas gracias por la ayuda amigos!