Thanks friends.
Well, I have something like that (22 ckeckboxes and none is obligatory), and that's what I was saying: If the visitor dials the 2 option, the 13 and the 22 , in the email I get breaks of intermediate lines (the ckeckboxes unchecked), and it is very ugly as is the body of the message.
<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);
if( $_SERVER['REQUEST_METHOD'] == 'POST') {
echo '<script type="text/javascript">
window.location.assign("url.html");
</script>';
//---------
$opcion1 .= $_POST['marcador1'];
$opcion2 .= $_POST['marcador2'];
$opcion3 .= $_POST['marcador3'];
$opcion4 .= $_POST['marcador4'];
.
.
$opcion22 .= $_POST['marcador22'];
//---------
$nombre .= $_POST['nombre'];
$mail .= $_POST['email'];
$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/plain";
//---------
$cuerpo_mensaje .= "Enviado por: " . $nombre . " \r\n";
$cuerpo_mensaje .= "E-Mail: " . $mail . " \r\n";
$cuerpo_mensaje .= "Mensaje:" . " \r\n\r\n";
//---------
$cuerpo_mensaje .= " " . $marcador1 . " \r\n";
$cuerpo_mensaje .= " " . $marcador2 . " \r\n";
$cuerpo_mensaje .= " " . $marcador3 . " \r\n";
$cuerpo_mensaje .= " " . $marcador4 . " \r\n";
.
.
$cuerpo_mensaje .= " " . $marcador22 . " \r\n\r\n";
//----------
// Aquí el codigo sigue con otros $cuerpo_mensaje adicionales
//----------
$para = 'aqui_el_correo';
$asunto = 'el_asunto';
mail($para, $asunto, utf8_decode($cuerpo_mensaje), $header, '-faqui_el_correo');
}
?>
Where do I put all the isset ...?
if(isset( $_POST['marcador x']){
$opcion x = $_POST['marcador x'];
}
Note that I only want to avoid receiving the indicated unchecked:
$cuerpo_mensaje .= " " . $marcador x . " \r\n";
I do not clarify much with this (php is not mine).
Thank you very much!