Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/06/2010, 01:15
babyqueso
 
Fecha de Ingreso: junio-2010
Mensajes: 1
Antigüedad: 13 años, 10 meses
Puntos: 0
Exclamación forulario con checkbox multiples enviado a un php

Buenas, necesito me ayuden con un formulario..
tengo este codigo en html.

<html>
<head>
<title>Formulario de Contacto</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="enviar.php">
<p>Nombre:<br />
<label>
<input name="nombre" type="text" id="nombre" />
</label>
<label></label>
<br />
Telefono:<br />
<input name="telefono" type="text" id="telefono" />
<br />
Email:<br />
<input name="email" type="text" id="email" />
</p>
<p> Mensaje:<br />
<textarea name="mensaje" id="mensaje"></textarea>
</p>
<p>
<label><input type="checkbox" name="check[]" value="valor1"/>Valor 1<br/>
<input type="checkbox" name="check[]" value="valor2"/>Valor 2<br/>
<input type="checkbox" name="check[]" value="valor3"/>Valor 3<br/>
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="Enviar Formulario" />
</label>
</p>
</form>
</body>
</html>

y lo envia a este php

<?php

$mail='[email protected]';


$nombre = $_POST['nombre'];
$telefono = $_POST['telefono'];
$email = $_POST['email'];
$mensaje = $_POST['mensaje'];


$thank="gracias.html";

$message = "
nombre:".$nombre."
telefono:".$telefono."
email:".$email."
mensaje:".$mensaje."";

if(isset($_POST['check']))
foreach($_POST['check'] as $key => $value)
echo "<input type='text' name='$key' value='$value'><br/>";

if (mail($mail,"Cotización",$message))
Header ("Location: $thank");

?>

El problema que tengo, es que me envia todos los otros datos, menos los checkboxes...

Agradesco de antemano su ayuda...