Comunidad de diseño web y desarrollo en internet online

Problema formulario php

Citar            
MensajeEscrito el 02 Dic 2006 09:12 am
He hecho este formulario (encuesta) pero no consigo que los mensajes lleguen...a que es devido?. La web està en Iespana.

Gracias

<?
if (!$_POST){
?>
<form action="encuesta.php" method=post>
<h2 style="margin-top:0px">Datos personales</h2>
Nombre y Apellidos
<input type="text" name="nombre" size="30" maxlength="100">
<br />
Edad
<input type="text" name="edad" size="30" maxlength="100">
<br />
Ciudad
<input type="text" name="ciudad" size="30" maxlength="100">
<br />
Email
<input type="text" name="email" size="25" maxlength="100">
<br />
<h2>Pregunta 1</h2>
<input type="radio" name="ciudadconcierto" value="1">Barcelona
<br>
<input type="radio" name="ciudadconcierto" value="2">Madrid
<br>
<h2>Pregunta 2</h2>
<input type="text" name="email" size="25" maxlength="100">
<h2>Pregunta 3</h2>
1.<input type="text" name="grupoprefe" size="30" maxlength="100"><br />
2.<input type="text" name="grupoprefe" size="30" maxlength="100"><br />
3.<input type="text" name="grupoprefe" size="30" maxlength="100"><br />
4.<input type="text" name="grupoprefe" size="30" maxlength="100"><br />
5.<input type="text" name="grupoprefe" size="30" maxlength="100"><br />
<h2>Pregunta 3</h2>
1.<input type="text" name="grupocd" size="30" maxlength="100"><br />
2.<input type="text" name="grupocd" size="30" maxlength="100"><br />
3.<input type="text" name="grupocd" size="30" maxlength="100"><br />
4.<input type="text" name="grupocd" size="30" maxlength="100"><br />
5.<input type="text" name="grupocd" size="30" maxlength="100"><br />
<h2>Pregunta 5.</h2>
<input type="text" name="preciocd" size="30" maxlength="100"><br />
Y por un dvd?<br />
<input type="text" name="preciodvd" size="30" maxlength="100"><br />
<h2>Pregunta 6.</h2>
<input type="text" name="conciertos" size="30" maxlength="100"><br />
<input type="submit" value="Enviar">
<input type="Reset" value="Borrar"><br />
</form>
<?
}else{
//Estoy recibiendo el formulario, compongo el cuerpo
$cuerpo = "Formulario enviado\n";
$cuerpo .= "Nombre: " . $_POST['nombre'] . "\n";
$cuerpo .= "Edad: " . $_POST['edad'] . "\n";
$cuerpo .= "Ciudad: " . $_POST['ciudad'] . "\n";
$cuerpo .= "Email: " . $_POST['email'] . "\n";
$cuerpo .= "Ciudadparaconcierto: " . $_POST['ciudadconcierto'] . "\n";
$cuerpo .= "Grupospreferidos: " . $_POST['grupoprefe'] . "\n";
$cuerpo .= "Cddegrupos: " . $_POST['grupocd'] . "\n";
$cuerpo .= "Preciocd: " . $_POST['preciocd'] . "\n";
$cuerpo .= "Preciodvd: " . $_POST['preciodvd'] . "\n";
$cuerpo .= "Conciertos: " . $_POST['conciertos'] . "\n";

//para el envío en formato HTML
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

//dirección del remitente
$headers .= "From: Encuesta <[email protected]>\r\n";

if(mail("[email protected]","Formulario recibido",$cuerpo, $headers))
{
echo "Gracias por participar en la encuesta.";
}
else
{
echo "No se puedo mandar";
}
}
?>

Por hector_he

9 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 02 Dic 2006 03:13 pm
hola, tu form si funciona, lo probe en mi host, solo tiene algunas variables repetidas y al momento de llegar esta un poco desordenado, aumentale un . "<br>" al final de cada linea de cuerpo y revisa tus variables.

Puede que sea problema de Iespana no lo se, nunca lo he usado, tal vez alguien que tenga el mismo servicio te pueda ayudar mas. Quizas tambien el correo te este llegando a tu carpeta de Spam o de correo no deseado.

chug0

Por chug0

Claber

136 de clabLevel



 

Perú

firefox
Citar            
MensajeEscrito el 02 Dic 2006 03:26 pm

chug0 escribió:

Quizas tambien el correo te este llegando a tu carpeta de Spam o de correo no deseado.
Revisa eso y también consulta si tu hosting puede tener la funcion mail bloqueada, en muchos hosting sucede eso, miralo o consultales

Por Yranac

421 de clabLevel



Genero:Masculino  

Lugo, Galicia

firefox
Citar            
MensajeEscrito el 02 Dic 2006 03:29 pm
Hola, antes de nada, gracias por contestarme chug0.
Lo de poner un <br /> más a cada variables es por que están muy juntas no? Lo arreglé con css poniendo un margin a input.

La verdad es que estoy desesperado ya que cuando pruevo yo mismo la encuesta me sale el mensaje de enviado correctamnete pero no llegan los mensajes y no se cual es la razón, no se si es por Iespana o falta de headers (como asunto..) o hotmail....

Gracias Ynarac, por lo que tango entendido tiene la función mail activada, ya lo miraré mejor...se puede ver aquí?
[url="phpinfo"]http://shibuyadepako.iespana.es/phpinfo.php[/url]

Por hector_he

9 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 02 Dic 2006 04:38 pm

hector_he escribió:


Lo de poner un <br /> más a cada variables es por que están muy juntas no? Lo arreglé con css poniendo un margin a input.


me refiero al formato del correo una vez que llega:
como esta tu archivo llegaria asi:

webmail escribió:

Formulario enviado Nombre: gkl,g Edad: ,ghj, Ciudad: h,ghj Email: fdgndf Ciudadparaconcierto: 2 Grupospreferidos: Cddegrupos: Preciocd: dfgn Preciodvd: dfgndfgn Conciertos: dfgn


Aumentandole un . "<br>" llegaria asi :

webmail escribió:


Formulario enviado
Nombre: gkl,g
Edad: ,ghj,
Ciudad: h,ghj
Email: fdgndf
Ciudadparaconcierto: 1
Grupospreferidos:
Cddegrupos:
Preciocd: dfgn
Preciodvd: dfgndfgn
Conciertos: dfgn


revisaste tu carpeta de spam o correo no deseado?

Por chug0

Claber

136 de clabLevel



 

Perú

konqueror
Citar            
MensajeEscrito el 04 Dic 2006 02:12 pm
Ok, gracias por el consejo.
Si he revisado el correo no deseado y tampoco, no entiendo cual puede ser el problema o buscar una alternativa que funcione!

Por hector_he

9 de clabLevel



Genero:Masculino  

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.