Ver Mensaje Individual
  #7 (permalink)  
Antiguo 31/12/2009, 17:39
Avatar de zaetoner
zaetoner
 
Fecha de Ingreso: noviembre-2007
Ubicación: La ciudad de México
Mensajes: 607
Antigüedad: 16 años, 5 meses
Puntos: 30
Respuesta: formulario e-mail

esta vez te voy a dar el codigo por que se ve que no tienes ni idea de esto, pero la proxima no tendras tanta suerte, ponte a leer las documentaciones!!!!!!

Código PHP:
Ver original
  1. <?php
  2. $nombre=$_POST['nombre'];
  3. $apellidos=$_POST['apellidos'];
  4. $telefono=$_POST['telefono'];
  5. $email=$_POST['email'];
  6. $mensaje=$_POST['mensaje'];
  7. $mensaje=nl2br($mensaje);
  8. $contactar=$_POST['contactar'];
  9. $ip=$_SERVER['REMOTE_ADDR'];
  10.  
  11. if($nombre and $apellidos and $telefono and $mensaje){
  12.  $head = "MIME-Version: 1.0\r\n";
  13.  $head.= "Content-type: text/html; charset=iso-8859-1\r\n";
  14.  $head.= "To:".$nombre." < [email protected] >\r\n";
  15.  $head.= "From: [email protected] \r\n";
  16.  $head.= "Cc: [email protected] \r\n";
  17.  $head.= "Bcc: [email protected]\r\n";
  18.  
  19.  $msg = "
  20.  
  21. Mensaje enviado desde pagina web.com<br>
  22. Nombre: $nombre <br>
  23. Apellidos: $apellidos <br>
  24. Telefono: $telefono <br>
  25. Email: $email <br>
  26. Mensaje: $mensaje <br>
  27. Modo de contacto: $contactar <br>
  28.  
  29. ";
  30.  mail($dest, "Salon las flores", $msg, $head);
  31.  
  32. $aviso="Gracias, nos pondremos en contacto con usted lo antes posible";
  33. $lleno="si";
  34. }else{
  35. $aviso="Por favor llene los campos con * (asterisco)";
  36. }
  37. include("cabezera.php");
  38. ?>
  39. <style media="all"  type="text/css">
  40. <!--
  41. #principal td { text-align:center}
  42. #principal td input{ width:300px}
  43. -->
  44. </style>
  45. <div id="contenido">
  46.     <div id="contenidoarriba"></div>
  47.         <div id="contenidocuerpo">
  48.             <div id="principal">
  49.                 <table>
  50.                 <form action="/contacto/" method="post">
  51.                 <tr><td colspan="2">Contacto con salon las flores</td></tr>
  52.                 <? if($aviso){?>
  53.                 <tr><td colspan="2"><?=$aviso?></td></tr>
  54.                 <? }
  55.                 if($lleno!="si"){
  56.                 ?>
  57.                 <tr><td>Nombre</td><td><input type="text" name="nombre" /></td></tr>
  58.                 <tr><td>Apellidos</td><td><input type="text" name="apellidos" /></td></tr>
  59.                 <tr><td>Telefono</td><td><input type="text" name="telefono" /></td></tr>                
  60.                 <tr><td>E-mail</td><td><input type="text" name="email" /></td></tr>
  61.                 <tr><td>Mensaje</td>
  62.                   <td><textarea style="width:300px; height:150px; float:left" name="mensaje"></textarea></td>
  63.                 </tr>
  64.                 <tr><td>Como desea que lo contactemos</td><td><input type="text" name="contactar" /></td></tr>
  65.                 <tr><td colspan="2"><input type="submit" value="enviar" /></td></tr>
  66.                 <?
  67.                 }
  68.                 ?>
  69.                 </form>
  70.                 </table>
  71.             </div>
  72.         </div>
  73.             <a href="http://www.zaetware.com/" title="web creada por zaetware.com"><div id="contenidopie"></div></a>
  74. </div>
  75. <?
  76. include("pie.php");
  77. ?>
__________________
...