Código PHP:
<table width="200" border="0">
<tr>
<td><div align="center"><strong><span class="style1">AUTORES</span></strong></div></td>
</tr>
</table>
<table width="608" border="0">
<tr>
<td><?
if (count($_POST['nomCat']) > 0) {
foreach($_POST["nomCat"] as $nomCat)
{
//echo "<br>DNI: "."$dni";
?>
<input type="hidden" name="nomCat[]" value="<? echo $nomCat; ?>" >
<?
}
}
if(count($_POST['nombreAut']) > 0)
{
foreach($_POST["nombreAut"] as $nomAut)
{
//echo "<br>DNI: "."$dni";
?>
<input type="hidden" name="nombreAut[]" value="<? echo $nomAut; ?>">
<tr><td>AUTOR: </td><td><? echo $nomAut; echo "<br>"; ?></td></tr>
<?
}
}
?>
</td>
<td width="135">Nombre y Apellidos:</td>
<td width="463"><input type="text" name="nombreAut[]" width="450"></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td> </td>
</tr>
</table>
<table width="487" border="0">
<tr>
<td width="481"><div align="right">
<input type="submit" name="AnyadirAutor" value="Añadir Autor">
</div></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td> </td>
</tr>
</table>
<table width="521" border="0">
<tr>
<td width="224" height="38"><div align="center"><strong><span class="style1">CATÁLOGO/S ASOCIADOS </span></strong></div></td>
</tr>
</table>
<table width="234" border="0">
<tr>
<td><? if (count($_POST['nombreAut']) > 0) {
foreach($_POST["nombreAut"] as $nomAut)
{
//echo "<br>DNI: "."$dni";
?>
<input type="hidden" name="nombreAut[]" value="<? echo $nomAut; ?>" >
<?
}
}
if (count($_POST['nomTema']) > 0) {
foreach($_POST["nomTema"] as $nomTema)
{
//echo "<br>DNI: "."$dni";
?>
<input type="hidden" name="nomTema[]" value="<? echo $nomTema; ?>" >
<?
}
}
if(count($_POST['nomCat']) > 0)
{
foreach($_POST["nomCat"] as $nomCat)
{
//echo "<br>DNI: "."$dni";
?>
<input type="hidden" name="nomCat[]" value="<? echo $nomCat; ?>" >
<tr><td>CATÁLOGO: </td><td><? echo $nomCat; echo "<br>"; ?></td></tr>
<?
}
}
?>
</td>
<td width="67">Nombre:</td>
<td width="157"><input type="text" name="nomCat[]"></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td> </td>
</tr>
</table>
<table width="499" border="0">
<tr>
<td width="481"><div align="right">
<input type="submit" name="AsignarCatalogo" value="Asignar Catálogo">
</div></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td> </td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td><div align="center"><strong><span class="style1">TEMÁTICA</span></strong></div></td>
</tr>
</table>
<table width="234" border="0">
<tr>
<td><? if (count($_POST['nomCat']) > 0) {
foreach($_POST["nomCat"] as $nomCat)
{
//echo "<br>DNI: "."$dni";
?>
<input type="hidden" name="nomCat[]" value="<? echo $nomCat; ?>" >
<?
}
}
if (count($_POST['nombreAut']) > 0) {
foreach($_POST["nombreAut"] as $nomAut)
{
//echo "<br>DNI: "."$dni";
?>
<input type="hidden" name="nombreAut[]" value="<? echo $nomAut; ?>" >
<?
}
}
if(count($_POST['nomTema']) > 0)
{
foreach($_POST["nomTema"] as $nomTema)
{
//echo "<br>DNI: "."$dni";
?>
<input type="hidden" name="nomTema[]" value="<? echo $nomTema; ?>" >
<tr>
<td>TEMA: </td>
<td><? echo $nomTema; echo "<br>"; ?></td></tr>
<?
}
}
?>
</td>
<td width="67">Nombre:</td>
<td width="157"><input type="text" name="nomTema[]"></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td> </td>
</tr>
</table>
<table width="499" border="0">
<tr>
<td width="481"><div align="right">
<input type="submit" name="AnyadirTema" value="Añadir Tema">
</div></td>
</tr>
</table> PD: esta claro que todo va dentro de un solo form...
incisto), siempre se cumplirá dicha condición, entonces entrará en tu foreach e imprimirá los campos ocultos como lo indicas: <input type="hidden" name="nomCat[]" value="<? echo $nomCat; ?>" >... ahora, como repites esas "impresiones" en varias partes de tu formulario... veo dos a simple vista... súmale!, esos dos campos ocultos tendrán los mismos datos (value="...") y un mismo name que "tu textbox visible" (el original)... entonces para la otra que envies se recojerán dos campos con los mismos datos... más tu textbox original... ¿llevamos?? tres... entonces se impimirán 4 campos ocultos con los mismos datos (enviaste 2 pero repites la impresión) que corresponderán a tu primer registro... más 2 nuevos campos igual ocultos con tu nuevo registro... más tu campo original.. ¿llevamos?
no alcanzo a ver si eso igual te duplicaria (nuevamente) los registros...
... lo siento.. no puedo acceder... aunque tengo una conexión lenta.. no creo que sea el problema (estoy navegando aquí ahora
ahora se me ocurre... ¿haz intentado adaptar un script de carrito de compras??... algo sencillo, creo te podría servir... me late, no lo sé... me parece que hay uno en desarrolloweb.com ...
