Ver Mensaje Individual
  #5 (permalink)  
Antiguo 02/08/2011, 09:34
Avatar de Patriarka
Patriarka
 
Fecha de Ingreso: enero-2011
Ubicación: Moreno, Buenos Aires, Argentina
Mensajes: 2.851
Antigüedad: 13 años, 3 meses
Puntos: 288
Respuesta: Formulario bastante complejo

A diferencia de lo que te dijo Bullan, creo que hiciste un buen avance y al menos nos mostraste lo que hiciste. En cuanto a las mejoras que te sugirio las vas a ir incorporando con la experiencia: yo haria estas correcciones y vos despues depuralos:

Código PHP:
Ver original
  1. <html>
  2.     <body>
  3.         <center>Modificar usuario</center>
  4.        
  5.  
  6. <?php
  7. include"conexion.php";
  8. $id=$_POST['id'];
  9. $result=mysql_query("select * from clientesl2",$conexion);
  10. while ($row=mysql_fetch_array($result)) {
  11. ?>
  12.  
  13. <form name="clientesl2<?php echo $row[0]?>" id="clientesl2<?php echo $row[0]?>" action="action-actualizar.php" method="POST">
  14. <input type="hidden" name="id" value="<?php echo $row[0]?>" />
  15.  
  16.         email :<input type="text" name="email" value="<?php echo $row[5]?>" /><p>
  17.        
  18.         telefono:<input type="text" name="telefono" value="<?php echo $row[4]?>" /><p>
  19.        
  20.         opcion:                 <input type="checkbox" name="opc" value="ok"/>OK</input>&nbsp;&nbsp;
  21.                                 <input type="checkbox" name="opc" value="nada" checked/>Nada</input>&nbsp;&nbsp;<p>
  22.                                
  23.                                 <input type="text" name="opc" value="<?php echo $row[3]?>" /><p>
  24.        
  25.         seleccion:              <input name="col" type="radio" value="si"/> si              &nbsp;&nbsp;
  26.                                 <input name="col" type="radio" value="no" checked/> no      &nbsp;&nbsp;
  27.                                 <input name="col" type="radio" value="nose"/>   nose        &nbsp;&nbsp;<p>
  28.                                 <textarea name="seleccion" rows="3" cols="40"><?php echo $row[2]?></textarea><p>
  29.         </tr>
  30.         mensaje:<textarea name="mensaje" rows="3" cols="40"><?php echo $row[1]?></textarea><p>
  31. <input name="enviar<?php echo $row[0]?>" type="submit" value="Modificar"><p>
  32. </form>
  33.     <a href="borrar.php?id=<?php echo $row[0]?>"><button>borrar</button></a><hr>
  34.  
  35. <?php
  36. }
  37. ?>
  38.  
  39. </body>
  40. </html>

Te agrege en el nombre del formulario <?php echo $row[0]?> para que no se repitan los formulario y un ID
con eso deberia funcionar "Modificar"

luego en el "Borrar":
<html>
<body>


Código PHP:
Ver original
  1. <?php
  2. include"conexion.php";
  3. $id=$_GET['id'];  //RECIBIS EL ID DEL REGISTRO A BORRAR POR GET
  4.  
  5. mysql_query("DELETE FROM `lineage2`.`clientesl2` WHERE `clientesl2`.`id` = '$id' ");
  6.  
  7. ?>
  8.         <b><hl><center><a href="index.html"><button>indice</button></a></center></hl></b><br>
  9.     </body>
  10. </html>

Pero para mi hiciste un buen intento, toma muy en cuenta lo que te dijo Bullan