Ver Mensaje Individual
  #22 (permalink)  
Antiguo 12/01/2011, 13:33
Avatar de Heiroon
Heiroon
 
Fecha de Ingreso: junio-2010
Ubicación: Caracas, Venezuela - Por ahora...
Mensajes: 495
Antigüedad: 13 años, 11 meses
Puntos: 63
Respuesta: Envio de formulario por php

mmm no entiendo.. lo acabo de probar y funciono perfectamente.. ahi tienes mi codigo...

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9.  
  10.  
  11.  
  12. <form action="" method="post" name="Formulario" id="Formulario">
  13. <fieldset>
  14. <p><label>Nombre <input name="nombre" type="text" id="nombre" size="25" /></label></p>
  15.  
  16. <p><label>Asunto <input name="asunto" type="text" id="asunto" size="20" /></label></p>
  17.  
  18. <p><label>Correo Electronico <input name="mail" type="text" id="mail" size="40" /></label></p>
  19.  
  20. Texto
  21. <p><label><textarea name="consulta" cols="50" rows id="consulta"></textarea>
  22. </label></p>
  23.  
  24. <input name="enviar" type="submit" id="enviar" value="ENVIAR"/>
  25. <input name="Restablecer" type="reset" value="LIMPIAR"/>
  26. </fieldset>
  27. </form>
  28. </body>
  29. </html>
  30.  
  31.  
  32. <?php
  33. if($_POST){
  34. $nombre = $_POST['nombre'];
  35. $mail = $_POST['mail'];
  36. $asunto = $_POST['asunto'];
  37.  
  38. $header = 'From: ' . $mail . " \r\n";
  39. $header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
  40. $header .= "Mime-Version: 1.0 \r\n";
  41. $header .= "Content-Type: text/plain";
  42.  
  43. $mensaje = "Este mensaje fue enviado por... " . $nombre . " \r\n";
  44. $mensaje .= "Su e-mail es: " . $mail . " \r\n";
  45. $mensaje .= "Mensaje: " . $_POST['consulta'] . " \r\n";
  46. $mensaje .= "Fue enviado... " . date('d/m/Y', time());
  47.  
  48.  
  49. if(mail($para,$asunto,utf8_decode($mensaje),$header)){?>
  50. <script>
  51.     window.location.href="correctamente.php";      
  52. </script>
  53. <? }else{ ?>
  54. <script>
  55.     window.location.href="correctamente.php";      
  56. </script>
  57. <? } }?>

ese error es que dejaste algo abierto.. pero a veces es que recargaste muy rapido la pagina..
__________________
Gmail : [email protected]
Twitter: @heiroon

I'm back!