Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/01/2014, 10:55
inesmchaparro00
 
Fecha de Ingreso: enero-2014
Mensajes: 4
Antigüedad: 10 años, 3 meses
Puntos: 0
Enviar opcion del select por php

Hola a todos.
Estoy dando los últimos toques a un formulario y me he encontrado con una duda que no consigo resolver.
Dentro del formulario (html) tengo un select simple con el siguiente código:
<div class="controls">
<select id="mi_select" name="mi_select" class="span12">
<option value="Departament">Select Department</option>
<option value="General">General</option>
<option value="Commercial">Commercial</option>
<option value="Sales">Sales</option>
<option value="Commercial">Deposit</option>
<option value="Sales">Withdraw</option>
</select>
</div>
Este código, obviamente, está dentro de su etiqueta form correspondiente, con method post.
Ahora bien, cuando hago el envío por php llegan al correo todos los datos extraídos menos la selección del select.

Este es mi código php:

<?php

if(!empty($_POST['firstname']) AND
!empty($_POST['lastname']) AND
!empty($_POST['useremail']) AND
!empty($_POST['usermessage'])){

$to ="[email protected]";
$headers = "Content-Type: text/html; charset=iso-8859-1\n";
$headers .= "From:".$_POST['firstname']."\r\n";
$tema="Contact from website";
$mensaje="
<table border='0' cellspacing='2' cellpadding='2'>

<tr>
<td width='20%' align='center' bgcolor='#FFFFCC'><strong>Firstname:</strong></td>
<td width='80%' align='left'>$_POST[firstname]</td>
</tr>
<tr>
<td width='20%' align='center' bgcolor='#FFFFCC'><strong>Lastname:</strong></td>
<td width='80%' align='left'>$_POST[lastname]</td>
</tr>
<tr>
<td width='20%' align='center' bgcolor='#FFFFCC'><strong>Email:</strong></td>
<td width='80%' align='left'>$_POST[useremail]</td>
</tr>
<tr>
<td align='center' bgcolor='#FFFFCC'><strong>Departament:</strong></td>
<td align='left'>$_POST[mi_select]</td>

</tr>

<tr>
<td align='center' bgcolor='#FFFFCC'><strong>Message:</strong></td>
<td align='left'>$_POST[usermessage]</td>
</tr>

</table>
";
@mail($to,$tema,$mensaje,$headers);
echo "<META HTTP-EQUIV='Refresh' CONTENT='0;URL=../contact-send.html'>";
} else {
echo "<META HTTP-EQUIV='Refresh' CONTENT='0;URL=../contact-error.html'>";
}



?>

¿Qué estoy haciendo mal?
He probado con $_REQUEST pero tampoco ha servido.

Cuando me llega el mensaje con los datos del formulario en lugar de aparecer la opción que había marcado en el select aparece la palabra Array.

Firstname: Inés
Lastname: MCh
Email: [email protected]
Departament: Array
Message: Prueba

Un saludo.