Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/10/2011, 09:15
Avatar de skiper0125
skiper0125
 
Fecha de Ingreso: octubre-2010
Ubicación: $this->Mexico('Toluca');
Mensajes: 1.127
Antigüedad: 14 años, 4 meses
Puntos: 511
Respuesta: if(isset($_POST['submit'])) para que sirve y donde se utiliza

Esta instrucción es saber si has enviado un formulario fue enviado a la misma página o en cualquier otra, recuerda que la variable $_POST['submit'] va relacionada al name del botón.

ejemplo:

crea una pagina llamada 1.php y pega este código para que entiendas un poco más este tema.

Código PHP:
Ver original
  1. <?php
  2.     if(isset($_POST['Submit'])){
  3.         echo 'se envio el formulario';
  4.     }
  5. ?>
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <title>Documento sin título</title>
  11. </head>
  12.  
  13. <body>
  14. <form id="form1" name="form1" method="post" action="1.php">
  15.     <input type="text" name="texto" id="texto" />
  16.     <input name="Submit" type="submit" value="Submit" />
  17. </form>
  18. </body>
  19. </html>

Saludos
__________________
Recuerda que estamos aquí para orientarte, y no para hacer tu trabajo.
Si mi aporte fue de ayuda, recuerda que agradecer no cuesta nada +1

Skiper0125