Tema: foreach
Ver Mensaje Individual
  #12 (permalink)  
Antiguo 21/07/2009, 15:53
Said012784
 
Fecha de Ingreso: julio-2009
Mensajes: 13
Antigüedad: 14 años, 10 meses
Puntos: 0
Respuesta: foreach

tu dices haciendo esto
Código PHP:
<?php
                          
for($i=1;$i<=$tot;$i++){ 
                        
?>  
                    
                    <tr> 
                        <td align="center" height="4" width="50%"> <font color="#0662AD"> <b>Pregunta<?php echo $i?></b> </font> </td> 
                        <td align="left" height="4" width="50%"><input type="text" name="p<?php echo $i?>[]" size="20%"></td>
                    </tr>
                    <tr> 
                        <td align="center" height="4" width="50%"> <font color="#0662AD"> <b>Total de Respuestas <?php echo $i;?>:</b> </font> </td> 
                        <td align="left" height="4" width="50%"><input type="text" name="tot_resp<?php echo $i?>[]" size="3%"></td>
                    </tr>
<tr> <td colspan="2"> <br> </td> </tr>
                    <?php ?>
o

esto

Código PHP:
<?php
                          
for($i=1;$i<=$tot;$i++){ 
                        
?>  
                    
                    <tr> 
                        <td align="center" height="4" width="50%"> <font color="#0662AD"> <b>Pregunta<?php echo $i?></b> </font> </td> 
                        <td align="left" height="4" width="50%"><input type="text" name="p[0,0]" size="20%"></td>
                    </tr>
                    <tr> 
                        <td align="center" height="4" width="50%"> <font color="#0662AD"> <b>Total de Respuestas <?php echo $i;?>:</b> </font> </td> 
                        <td align="left" height="4" width="50%"><input type="text" name="tot_resp[0,0]" size="3%"></td>
                    </tr>
                    <tr> <td colspan="2"> <br> </td> </tr>
                    <?php ?>