Ver Mensaje Individual
  #7 (permalink)  
Antiguo 28/05/2010, 04:47
Avatar de Nekeniehl
Nekeniehl
 
Fecha de Ingreso: julio-2009
Ubicación: Berlin, Alemania / Granada, España
Mensajes: 132
Antigüedad: 14 años, 9 meses
Puntos: 6
Respuesta: Problema con formulario

Te lo explico más graficamente en un ejemplo:

Mal:
Código PHP:
Ver original
  1. <?php
  2. echo "<form name='test' method='post' action='#'>";
  3. echo "<input type='submit' name='test' value='test'>";
  4. echo "</form>";
  5. if (isset($_POST['test'])){
  6.     echo "<form name='borra' method='post' action='#'>";
  7.     echo "<input type='submit' name='aceptoborrar' value='confirmar accion'>";
  8.     echo "</form>";
  9.  
  10.     if (isset($_POST['aceptoborrar']))
  11.     {
  12.  
  13.     echo "Entrando al form";
  14.     }
  15. }
  16. ?>

Bien:
Código PHP:
Ver original
  1. <?php
  2. echo "<form name='test' method='post' action='#'>";
  3. echo "<input type='submit' name='test' value='test'>";
  4. echo "</form>";
  5. if (isset($_POST['test'])){
  6.     echo "<form name='borra' method='post' action='#'>";
  7.     echo "<input type='submit' name='aceptoborrar' value='confirmar accion'>";
  8.     echo "</form>";
  9. }
  10. if (isset($_POST['aceptoborrar']))
  11. {
  12.  
  13.    echo "Entrando al form";
  14. }
  15. ?>
__________________
Antes de cambiar el mundo...dá tres vueltas por tu casa

Usa Google es tu amigo ;)