Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/05/2005, 12:47
CapiCapi
 
Fecha de Ingreso: mayo-2005
Mensajes: 78
Antigüedad: 18 años, 11 meses
Puntos: 0
Una ayuda, se me resiste el codigo...

Hola a todos, a ver quien me puede hechar una mano xq no consigo que funcione, ponerlo en un php con el form y entendereis lo que digo, agregar varios autores o varios temas o varios catalogos y lo entendereis, se me repite el mismo en la lista varias veces:

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>&nbsp;</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>&nbsp;</td>
    </tr>
  </table>
  <table width="521" border="0">
    <tr>
      <td width="224" height="38"><div align="center"><strong><span class="style1">CAT&Aacute;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>&nbsp;</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>&nbsp;</td>
    </tr>
  </table>
  <table width="200" border="0">
    <tr>
      <td><div align="center"><strong><span class="style1">TEM&Aacute;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>&nbsp;</td>
    </tr>
  </table>
  <table width="499" border="0">
    <tr>
      <td width="481"><div align="right">
        <input type="submit" name="AnyadirTema" value="A&ntilde;adir Tema">
      </div></td>
    </tr>
  </table>
GRACIAS!!!!

PD: esta claro que todo va dentro de un solo form...

Última edición por CapiCapi; 08/05/2005 a las 13:05