Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/09/2012, 09:16
Avatar de fermin3d
fermin3d
 
Fecha de Ingreso: octubre-2010
Ubicación: sevilla
Mensajes: 141
Antigüedad: 13 años, 6 meses
Puntos: 4
Respuesta: formulario de contacto

este es el codigo que e realizado pero me llega vacio los mensajes

Código PHP:
Ver original
  1. <?php
  2.  
  3. $nombre = $_POST['nombre'];
  4. $mail = $_POST['mail'];
  5. $telefono = $_POST['telefono'];
  6. $localidad = $_POST['localidad'];
  7. $depar = $_POST['depar'];
  8. $asunto = $_POST['asunto'];
  9. $texto = $_POST['texto'];
  10.  
  11.  
  12. $header = 'From: ' . $mail . " \r\n";
  13. $header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
  14. $header .= "Mime-Version: 1.0 \r\n";
  15. $header .= "Content-Type: text/plain";
  16.  
  17. $mensaje = "Este mensaje fue enviado por " . $nombre . " \r\n";
  18. $mensaje .= "Su e-mail es: " . $mail . " \r\n";
  19. $mensaje .= "Comentario: " . $_POST['Texto'] . " \r\n";
  20. $mensaje .= "Enviado el " . date('d/m/Y', time());
  21.  
  22. $depar = '[email protected]';
  23.  
  24. mail($depar, $asunto, utf8_decode($mensaje), $header);
  25.  
  26. ?>
Código HTML:
Ver original
  1. <form method="post" action="contact.html" onsubmit="return validacion(this)">
  2.            <table align="center">
  3.             <tr>
  4.              <td><strong>Nombre*</strong><br />
  5.                  <input type="text" maxlength="30" size="40" name="nombre" class="input" value=""/></td>
  6.                </tr>
  7.               <tr>
  8.              <td><strong>Email*</strong><br />
  9.                  <input type="email" maxlength="30" size="40" name="email" class="input"/></td>
  10.                </tr>
  11.               <tr>
  12.              <td><strong>Teléfono</strong><br />
  13.                 <input type="number" maxlength="10" size="40" name="telefono" value="" class="input"/></td>
  14.                </tr>
  15.               <tr>
  16.             <td><strong>Localidad*</strong><br />
  17.                 <input type="text" maxlength="30" size="40" name="localidad" class="input"/></td>
  18.                </tr>
  19.              <tr>
  20.            <td><strong>Departamento*</strong><br />
  21.            
  22.                <select class="input" name="depar">
  23.                <option selected="selected">Seleccione un Departamento</option>
  24.                <option value="@gmail.com">Diseño</option>
  25.                <option value="info@">Servicios</option>
  26.                <option value="info@">Consultaría</option>
  27.                <option value="info@">Administración</option>
  28.                </select></td>
  29.              </tr>
  30.             <tr>
  31.             <td><strong>Asunto*</strong><br />
  32.                 <input type="text" maxlength="30" size="40" name="asunto" class="input"/></td>
  33.                </tr>
  34.             <tr>
  35.            <td><strong>Mensaje*</strong><br />
  36.                <textarea name="texto" class="input2" onClick='texto.value=""'>Escriba aqui su......</textarea></td>
  37.             </tr>
  38.           <tr>
  39.            <td><input type="submit" name="enviar" value="Enviar" style="padding:5px;" onclick="return validar(this.form);" /></td>
  40.             </tr>
  41.    </table>
  42.    </form>

Muchas gracias a todos.