Ver Mensaje Individual
  #6 (permalink)  
Antiguo 19/11/2012, 13:04
dambor
 
Fecha de Ingreso: noviembre-2012
Mensajes: 4
Antigüedad: 11 años, 6 meses
Puntos: 0
Respuesta: formulario php con casillas de verificación

Cita:
Iniciado por quimfv Ver Mensaje
Código PHP:
Ver original
  1. ...
  2. $MESSAGE_BODY .= "Mensaje: ".nl2br($_POST["mensaje"])."<br>";
  3. if(isset($_POST['enviar']))
  4. {
  5.     foreach($_POST['so'] As $sistemas)
  6.     {
  7.         $MESSAGE_BODY .="selecciono los sistemas $sistemas <br>";
  8.     }
  9. }
  10. ...
Haciéndolo así no me aparece nada, mi nuevo código sería:

Código HTML:
Ver original
  1. <form id="form1" name="form1" method="post" action="procesar.php">
  2. <input name="formulario" type="hidden" value="formularioemprendedores" />
  3. <input name="nombre" type="text" id="nombre" size="35" />
  4. <input name="email" type="text" id="email" size="35" />
  5. <input name="asunto" type="text" id="asunto" size="35" />
  6. <textarea name="mensaje" cols="35" rows="5" id="mensaje"></textarea>
  7. <input type="checkbox" name="so[]" value="linux">
  8. <input type="checkbox" name="so[]" value="windows">
  9. <input type="checkbox" name="so[]" value="mac">
  10. <input type="submit" name="Submit" value="Enviar" />
  11. </form>

Código PHP:
Ver original
  1. <?php
  2. $para = '[email protected]';
  3.  
  4. $asunto = $_POST["asunto"];
  5. $mailheader = "From: ".$_POST["formulario"]."\r\n";
  6. $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
  7. $MESSAGE_BODY = "Nombre: ".$_POST["nombre"]."<br>";
  8. $MESSAGE_BODY .= "Email: ".$_POST["email"]."<br>";
  9. $MESSAGE_BODY .= "Asunto: ".$_POST["asunto"]."<br>";
  10. $MESSAGE_BODY .= "Mensaje: ".nl2br($_POST["mensaje"])."<br>";
  11. if(isset($_POST['enviar']))
  12. {
  13.     foreach($_POST['so'] As $sistemas)
  14.     {
  15.         $MESSAGE_BODY .="selecciono los sistemas $sistemas <br>";
  16.     }
  17. }
  18. mail($para, $asunto, $MESSAGE_BODY, $mailheader) or die ("Error al enviar el Formulario !");
  19.  
  20. header( 'Location: http://www.miweb.com/enviado.html' )
  21. ?>

Pero en el mail que recibo no aparece nada relativo a los checkbox, llega algo así:
Nombre: XXXX
Email: [email protected]
Asunto: El asunto que haya puesto
Mensaje: blablabla

Gracias por todo