Ver Mensaje Individual
  #6 (permalink)  
Antiguo 30/11/2015, 14:54
PsiLy
 
Fecha de Ingreso: noviembre-2015
Ubicación: Monterrey
Mensajes: 9
Antigüedad: 8 años, 5 meses
Puntos: 0
Pregunta Respuesta: Formulario php

Cita:
Iniciado por diegoj9999 Ver Mensaje
Que error te tira?
Es solo ese codigo?

EDIT: Hola solo vi un error de undefined index

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!";
  32.         }
  33.     }  
  34. ?>
Me funciono! Muchas Gracias!
En verdad no entendí mucho que hiciste pero me ayudo bastante!


Solo una pregunta más, como le pongo estilo a los echos de este php? hay alguna manera?