Good morning. I have a form that collects the data that is inserted and sent to a page in php in charge of making the shipment. The whole process is done well, except for the field referring to a select, whose field is not sent, even in white. I attach the code fragment:
<form id="Formulario" name="formucontacto" action="envio.php">
<fieldset>
<input type="text" id='nombre' name="nombre" placeholder="Introduce tu nombre..." required>
<input id='mail' name="mail" type = 'email' placeholder="Introduce tu correo electrónico" required>
<input id='Telefono' name="telefono" type = 'text' placeholder="Introduce tu telefono" required>
<select id="producto" name='producto' required>
<option value="" default>-- Selecciona tu producto --</option>
<option value="1">Producto1</option>
<option value="2">Producto2</option>
<option value="3">Producto3</option>
<option value="4">Producto4</option>
<option value="5">Producto5</option>
<option value="6">Otro...</option>
</select>
<input type="submit" onclick="if (validarcontacto()) this.form.submit()" id="solicitar" value="SOLICITAR"/>
</form>
</fieldset>
By clicking on the button REQUEST a function is called where it is verified if the fields are empty or not, and if everything is correct, the form is sent to a php page with the following function at the beginning of it:
<?php
foreach($_REQUEST as $campo=>$valor){
.$texto .= $campo.": ".$valor."\n\n";
}
$cabeceras = 'From: $config_email'."\r\n";
$cabeceras .= 'MIME-Version: 1.0'."\r\n";
$cabeceras .= 'Content-type: text/html; charset=utf8'."\r\n";
$cabeceras .= 'Bcc: [email protected]' . "\r\n";
//Envio de mail
mail("[email protected]", "Mensaje desde la Web", nl2br($texto), $cabeceras);
?>
As I said before, it works correctly, but the select field does not send it to me, I have tried giving it a name attribute like the rest, but everything is the same. I appreciate all help, thank you very much.