Ver Mensaje Individual
  #8 (permalink)  
Antiguo 21/03/2012, 11:04
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 9 meses
Puntos: 1567
Respuesta: Puedo hacer un submit de formulario mediante post usando antes un script d

Código PHP:
Ver original
  1. <?php
  2. ## este es un archivo php que contiene código html puro
  3. ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  5. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <title>titulo</title>
  9. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  10. <script type="text/javascript">
  11. //<![CDATA[
  12. function validar(){
  13. var email = document.getElementById("email").value;
  14. var telefono = document.getElementById("telefono").value;
  15. if((email == "")||(telefono == "")){
  16. alert('Ingrese su Email y su teléfono');
  17. return false;
  18. }
  19. }
  20. //]]>
  21. </script>
  22. </head>
  23. <body>
  24. <?php
  25. $x = "variable";
  26. ?>
  27. <form action="email.php" onsubmit="return validar();">
  28. <input type="text" name="email" id="email" /><br />
  29. <input type="text" name="telefono" id="telefono" />
  30. <input type="submit" />
  31. </form>
  32. <div>
  33. <?php
  34. if($x == "variable"){
  35. echo "Hola";
  36. }
  37. ?>
  38. </div>
  39. </body>
  40. </html>

@Jor1980... Urgente !!!! los manuales
Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.