Ver Mensaje Individual
  #6 (permalink)  
Antiguo 29/05/2011, 23:52
tuday
 
Fecha de Ingreso: mayo-2011
Mensajes: 1
Antigüedad: 13 años
Puntos: 0
Respuesta: Problema con el formulario

Hola!
Estoy armando un formulario, que al presionar el boton enviar me llegue a un mail, estoy teniendo problemas con el Checkbox, no se de que manera se envie 1 o varias casillas seleccionadas por PHP. les paso el HTML y el php asi me podras decir que codigo deberia incluir, espero me puedan ayudar!!!

*Codigo HTML*
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" media="screen" type="text/css" href="novios1.css" />
</head>
<body>
<div id="centrado">
<div id="top">

<div id="top_der">
<p>Encuesta</p>
</div>
</div>
<div id="contenido" class="float">
<div id="fotoss">
<div id="nombres">

<img src="imgs/novios.gif" alt="Foto de los novios">
</div>

</div>
<div id="txt_der">
<div id="txt">

<form id="contacto" name="contacto" method="post" action="enviar.php">

<p><label>Nombre:<br />
<input type="text" name="nombre" id="nombre" size="30" />
</label></p>
<p><label>Apellido:<br />
<input type="text" name="ape" id="ape" size="30" />
</label></p>
<p><label>Mail:<br />
<input type="text" name="mail" id="mail" size="30" />
</label></p>
<p><label>Telefono:<br />
<input type="text" name="telefono" id="telefono" size="30" />
</label></p>

<p>¿A través de que medio busca los diferentes productos <br />para su evento?
(todas las respuestas Pasa a N°4):</label><br />
<input type="checkbox" name="busca" id="publicidad" value="publicidad" checked/>Publicidad en revistas<br />
<input type="checkbox" name="busca" id="internet" value="internet"/>Por internet<br />
<input type="checkbox" name="busca" id="recomendacion" value="recomendacion"/>Por recomendaci&oacute;n<br />
<input type="checkbox" name="busca" id="otro" value="otro"/>Otro<br />
</p><br />

<p><label>Añade tu comentario:<br />
<textarea name="mensaje" cols="40" rows="8" id="mensaje">
</textarea>
</label></p>

<p><input type="submit" name="Submit" value="Enviar" />
<input type="reset" name="Submit" value="Borrar" /></p>
</form>
</div>
</div>
</div>
</body>
</html>

*Codigo PHP*
<?php
$nombre = $_POST['nombre'];
$ape = $_POST['ape'];
$mail = $_POST['mail'];
$telefono = $_POST['telefono'];
$checkbox= $_POST['busca'];
$mensaje = $_POST['mensaje'];

$header = 'From: ' . $mail . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= 'Content-type: text/html' . "\r\n";

$mensaje = "Este mensaje fue enviado por: ". "<strong>".$nombre . "</strong> "." " ."<strong>".$ape ."</strong> "." ";
$mensaje .= "* Su e-mail es: " ."<strong>". $mail ."</strong> ". "<br />". "<br />";
$mensaje .= "*.¿A traves de que medio busca los diferentes productos para su evento?:" ." "."<strong>". $_POST['busca'] ."</strong> ". "<br />";

$mensaje .= "* Su telefono es: " . "<strong>". $telefono . "</strong> "."<br />". "<br />";
$mensaje .= "* Mensaje: ". "<strong>". $_POST['mensaje'] . "</strong> ". "<br />". "<br />";
$mensaje .= "Enviado el " . date('d/m/Y', time());

$para = '[email protected]';
$asunto = 'Encuesta';

mail($para, $asunto, utf8_decode($mensaje), $header);

header('Location: gracias.html');
?>

Espero que alguno se apiade y me conteste..... a [email protected]
Rosario