Ver Mensaje Individual
  #12 (permalink)  
Antiguo 24/11/2006, 20:21
Avatar de hector_he
hector_he
 
Fecha de Ingreso: agosto-2006
Ubicación: Barcelona
Mensajes: 207
Antigüedad: 17 años, 8 meses
Puntos: 4
Muchas gracias por los consejos y por vuestro tiempo komodo y safe!
He intentado cmbiar la dirección de correo, poner mas heads, pero no me aparece el mensaje correcto pero los mensajes no llegan.

Seguiré intentando.

Código PHP:
<? 
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";  
}
}
?>