Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/12/2009, 10:45
Avatar de masterojitos
masterojitos
 
Fecha de Ingreso: julio-2008
Ubicación: Lima Callao Chucuito
Mensajes: 1.931
Antigüedad: 16 años, 6 meses
Puntos: 105
Respuesta: Fallo en codigo de formulario

pero si no estas cerrando el input .....

cambia esto:
Código php:
Ver original
  1. $result = mysql_query("SELECT * FROM datos", $db);
  2. $cant=mysql_num_rows($result);
  3. if ($cant){
  4.  
  5. echo "<form action='grabaxml.php' method='post'>";
  6. echo "<table width='600' border = '1'> \n";
  7. echo "<tr><td>Fecha</td><td>Nombre</td><td>Explicación</td></tr> \n";
  8.  
  9. $i=0;
  10.  
  11.     while($row = mysql_fetch_array($result)){
  12.  
  13.     // SOLO MUESTRA LA PRIMERA PALABRA DE CADA CAMPO Y HE PROBADO STRIPSLASHES
  14.     echo "<tr><td><input maxlength='30' type='text' value=".$row['fecha'].
  15.     "</td><td><input type='text' value=".$row['nombre'].
  16.     "</td><td><input type='text' value=".$row['explica'].
  17.     "</td></tr> ";
  18.  
  19.         $matriz[$i][0]=$row['fecha'];
  20.         $matriz[$i][1]=$row['nombre'];
  21.         $matriz[$i][2]=$row['explica'];
  22.    
  23.             $i++;
  24.     }
  25.    
  26.     echo "</table> \n";
  27.     echo "<input type='submit' value ='Enviar'>";
  28.     echo "</form>";
  29.    
  30. } else {
  31. echo "¡ No se ha encontrado ningún registro !";
  32.  
  33. }

por esto:
Código php:
Ver original
  1. $result = mysql_query("SELECT * FROM datos", $db);
  2. $cant=mysql_num_rows($result);
  3. if ($cant){
  4.  
  5. echo "<form action='grabaxml.php' method='post'>";
  6. echo "<table width='600' border = '1'> \n";
  7. echo "<tr><td>Fecha</td><td>Nombre</td><td>Explicación</td></tr> \n";
  8.  
  9. $i=0;
  10.  
  11.     while($row = mysql_fetch_array($result)){
  12.  
  13.     // SOLO MUESTRA LA PRIMERA PALABRA DE CADA CAMPO Y HE PROBADO STRIPSLASHES
  14.     echo "<tr><td><input type='text' value='".$row['fecha']."' /></td>";
  15.     echo "<td><input type='text' value='".$row['nombre']."' /></td>";
  16.     echo "<td><input type='text' value='".$row['explica']."' /></td></tr> ";
  17.  
  18.         $matriz[$i][0]=$row['fecha'];
  19.         $matriz[$i][1]=$row['nombre'];
  20.         $matriz[$i][2]=$row['explica'];
  21.    
  22.             $i++;
  23.     }
  24.    
  25.     echo "</table> \n";
  26.     echo "<input type='submit' value ='Enviar'>";
  27.     echo "</form>";
  28.    
  29. } else {
  30. echo "¡ No se ha encontrado ningún registro !";
  31.  
  32. }
__________________
Atte. MasterOjitos :ojotes:
Todo sobre Programación Web
Las ultimas tendencias en Efectos y Recursos Web: MasterOjitos Blog