Ver Mensaje Individual
  #9 (permalink)  
Antiguo 30/11/2015, 16:59
diegoj9999
 
Fecha de Ingreso: noviembre-2015
Ubicación: NULL
Mensajes: 23
Antigüedad: 9 años, 2 meses
Puntos: 1
Respuesta: Formulario php

Prueba asi

Código PHP:
Ver original
  1. <?php
  2.  
  3.  
  4. if (isset($_REQUEST['action'])==NULL) {
  5.      ?>
  6.     <form  action="" method="POST" enctype="multipart/form-data">
  7.     <input type="hidden" name="action" value="submit">
  8.     Your name:<br>
  9.     <input name="name" type="text" value="" size="30"/><br>
  10.     Your email:<br>
  11.     <input name="email" type="text" value="" size="30"/><br>
  12.     Your message:<br>
  13.     <textarea name="message" rows="7" cols="30"></textarea><br>
  14.     <input type="submit" value="Send email"/>
  15.     </form>
  16.     <?php
  17.     }  
  18. else                /* send the submitted data */
  19.     {
  20.     $name=$_REQUEST['name'];
  21.     $email=$_REQUEST['email'];
  22.     $message=$_REQUEST['message'];
  23.     if (($name==NULL)||($email==NULL)||($message==NULL))
  24.         {
  25.         echo "All fields are required, please fill <a href=\"\">the form</a> again.";
  26.         }
  27.     else{        
  28.         $from="From: $name<$email>\r\nReturn-path: $email";
  29.         $subject="Message sent using your contact form";
  30.         mail("[email protected]", $subject, $message, $from);
  31.         echo "Email sent!<br>";
  32.         ?>
  33. <html>
  34. <head>
  35. <title>Redireccion</title>
  36. <meta http-equiv="Refresh" content="5;URL=url a redireccionar
  37. ">
  38. </head>
  39. <body>
  40. Sera redirigido en unos segundos...
  41. </body>
  42. </html>
  43. <?php
  44.         }
  45.     }  
  46.    
  47. ?>

en "url a redireccionar" pon la url donde se encuentra el formulario, saludos