Webmaster - Probñlema formulario php

 
Vista:

Probñlema formulario php

Publicado por hector (1 intervención) el 29/11/2006 20:26:39
Tengo un problema con el fórmulario php, los coreeos no llegan a su destino.
La página està subida a Iespana.
Gracias

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";
}
}
?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder