Ver Mensaje Individual
  #7 (permalink)  
Antiguo 30/11/2015, 14:55
Avatar de lauser
lauser
Moderator Unix/Linux
 
Fecha de Ingreso: julio-2013
Ubicación: Odessa (Ukrania)
Mensajes: 3.278
Antigüedad: 10 años, 9 meses
Puntos: 401
Respuesta: Formulario php

Con esta modificación funciona... probado.

Código PHP:
Ver original
  1. <?php
  2. $action=$_REQUEST['action'];
  3. if ($action=="")    /* display the contact form */
  4.     {
  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=="")||($email=="")||($message==""))
  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.         $MailSent = mail("[email protected]", $subject, $message, $from);
  31.         if($MailSent == true) {
  32.              echo 'Mail Sent';
  33.         } else {
  34.              echo 'Mail failed';    
  35.         }
  36.     }  
  37. ?>
__________________
Los usuarios que te responden, lo hacen altruistamente y sin ánimo de lucro con el único fin de ayudarte. Se paciente y agradecido.
-SOLOLINUX-