FORMULARIO DE CONTACTO
Publicado por Mariana (2 intervenciones) el 02/11/2015 21:38:11
Hola! Necesito ayuda con mi formulario de contacto en mi web... Me llega el mail perfecto pero me llega vacio el campo de mensaje! No puedo encontrar el error...mando como tngo el HTML y el php.
Gracias!
-------------------------------------------------------------------------Form HTML--------------------------------------------------------------
---------------------------------------------------------------------------PHP---------------------------------------------------------------------
Gracias!
-------------------------------------------------------------------------Form HTML--------------------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<form method="post" action="enviar.php">
<label for="Nombre">Nombre:</label>
<input type="text" name="nombre" id="nombre"/>
<label for="email">E-mail:</label>
<input type="text" name="email" id="email"/>
<label for="telefono">Teléfono:</label>
<input type="text" name="telefono" id="telefono"/>
<label for="mensaje">Mensaje:</label>
<textarea id="mensaje" name"mensaje"></textarea>
<input type="submit" id="btnSubmit" value="Enviar"/>
</form>
---------------------------------------------------------------------------PHP---------------------------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
$nombre = $_POST['nombre'];
$email = $_POST['email'];
$telefono = $_POST['telefono'];
$mensaje = $_POST['mensaje'];
if (eregi('http:', $mensaje)) {
die ("No están permitidos los links con -http://-! ! ");
}
if(!$email == "" && (!strstr($email,"@") || !strstr($email,".")))
{
echo "<h2>Por favor ingrese un e-mail válido</h2>\n";
$badinput = "<h4>Su mensaje NO ha sido enviado</h4>\n";
echo $badinput;
die ("<a href='javascript: history.go(-1)'> Regresar! </a>");
}
$subject = 'Contacto desde .com.ar' ;
$mensaje = stripcslashes($mensaje);
$message = "De: $nombre \n
E-mail: $email \n
Teléfono: $telefono \n
Mensaje: $mensaje \n ";
$from = "From: $email \r\n";
mail ("********@hotmail.com", $subject, $message, $from);
?>
Valora esta pregunta


0