How do i get the value from the select in to my mail?
php code
if (isset($_POST['voorletters']) && isset($_POST['achternaam']) && isset($_POST['geboortedatum'])
&& isset($_POST['email'])){
$voorletters = $_POST['voorletters'];
$achternaam = $_POST['achternaam'];
$geboortedatum = $_POST['geboortedatum'];
$email = $_POST['email'];
$selectedOption = $_POST['pakketkeuze'];
if (!empty($voorletters) && !empty($achternaam) && !empty($geboortedatum) && !empty($email)){
$selectedPakketkeuze = 'None';
if(isset($_POST['pakketkeuze']) && is_array($_POST['pakketkeuze']) && count($_POST['pakketkeuze']) > 0){
$selectedPakketkeuze = implode(', ', $_POST['pakketkeuze']);
}
$to = 'contact@pkschoonmaakdiensten.nl'; // Waar moet het naartoe?
$sebject = 'Inschrijfing'; // Het onderwerp van het bericht
$body = 'this is a test'."\n\n".'Voorletters: '.$voorletters."\n".'Achternaam: '.$achternaam."\n".'Pakketkeuze: '.$Pakketkeuze;
$headers = 'From: '.$email;
if (@mail($to, $sebject, $body, $headers)){
echo 'the email send';
}else{
echo 'error sending email';
}
}else{
echo 'er is iets niet ingevuld';
}
}
html code
I need this value from this option, so when selected it will turn up in the mail when it will be sended.
<tr>
<td class="form-label"><h2>Abonnement keuze *</h2></td>
<td>
<span>
<select name="pakketkeuze" class="selection-menu-inschrijfform">
<option> --- </option>
<option value="basic"> Basic</option>
<option value="normaal"> Normaal</option>
<option value="plus"> Plus</option>
</select>
</span>
</td>
Any help is welcome
Woensdag
` – user3638080 Jul 14 '14 at 10:58