Ver Mensaje Individual
  #7 (permalink)  
Antiguo 04/04/2012, 15:29
Avatar de gjx2
gjx2
 
Fecha de Ingreso: agosto-2008
Ubicación: R.D
Mensajes: 1.153
Antigüedad: 15 años, 8 meses
Puntos: 139
Respuesta: Como puede mostrar el valos de un array en un input

hice una prueba de laboratorio fijate bien en el codigo y adaptalo.
Código PHP:
Ver original
  1. <?php
  2.    
  3.    
  4.     $_POST['clave3'] = array("p0","p1","p2","p3","p4","p5","p6","p7","p8");
  5.     $_POST['p1'] = array("p0","p1","p2","p3","p4","p5","p6","p7","p8");
  6.        
  7.       foreach($_POST["clave3"] as $i => $value){
  8.                 /*
  9.                   Update .....
  10.                 */
  11.  
  12.     }
  13.    
  14. ?>
  15.  
  16.  
  17. <form action="<?php echo $editFormAction; ?>" method="post" id="form1">
  18.   <table border="0" class="normal">
  19.  
  20.   <thead>
  21.     <tr>
  22.        
  23.     </tr>
  24.   </thead>
  25.   <?php
  26.  
  27.   # Fijate en esto he inicializado la variable $i
  28.  $i = 0;
  29.  
  30.   do {
  31.  
  32.   ?>
  33.   <tbody>
  34.    
  35.  <tr>
  36.  <td><?php echo $i; ?></td>  
  37.  <td><input   type="text"  name="p1[]" id="p1" value="<?php echo $_POST['p1'][$i]; ?>"   /> </td>
  38. </tr>
  39.  <?php $i++; } while ( $i < count($_POST['p1'])); ?>
  40.  
  41.  
  42.  </tbody>