<?php
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$totalDrank = (int) $_POST['drank1'] +( int) $_POST['drank2'] + (int) $_POST['drank3'];
if($totalDrank == -6) {
header('Location: http://www.google.nl'); } elseif($totalDrank > -5 && $totalDrank < 5) {
header('Location: http://www.google.nl'); } elseif($totalDrank == 6) {
header('Location: http://www.google.be'); }
} else {
?>
<form method="post" action="">
<select name="drank1">
<optgroup label="1ste Jaar">
<option value="-1">Eikenbarst</option>
<option value="-1">Wilgenblad</option>
<option value="-1">Heksenpaddestoel</option>
<option value="-1">Maanbes</option>
</optgroup><optgroup label="2de jaar">
<option value="-1">Herbatis</option>
<option value="-1">Kikkerbillen</option>
<option value="1">Slangengras</option>
<option value="-1">Keveroog</option>
</optgroup><optgroup label="3de jaar">
<option value="-1">Eenhoornhoorn</option>
<option value="-1">Drakenei</option>
<option value="-1">Drakengif</option>
<option value="-1">Vleermuisvlegels</option>
</optgroup>
</select>
<select name="drank2">
<optgroup label="1ste Jaar">
<option value="-2">Eikenbarst</option>
<option value="-2">Wilgenblad</option>
<option value="-2">Heksenpaddestoel</option>
<option value="-2">Maanbes</option>
</optgroup><optgroup label="2de jaar">
<option value="-2">Herbatis</option>
<option value="-2">Kikkerbillen</option>
<option value="2">Slangengras</option>
<option value="-2">Keveroog</option>
</optgroup><optgroup label="3de jaar">
<option value="-2">Eenhoornhoorn</option>
<option value="-2">Drakenei</option>
<option value="-2">Drakengif</option>
<option value="-2">Vleermuisvlegels</option>
</optgroup>
</select>
<select name="drank3">
<optgroup label="1ste Jaar">
<option value="-3">Eikenbarst</option>
<option value="-3">Wilgenblad</option>
<option value="-3">Heksenpaddestoel</option>
<option value="-3">Maanbes</option>
</optgroup><optgroup label="2de jaar">
<option value="-3">Herbatis</option>
<option value="-3">Kikkerbillen</option>
<option value="3">Slangengras</option>
<option value="-3">Keveroog</option>
</optgroup><optgroup label="3de jaar">
<option value="-3">Eenhoornhoorn</option>
<option value="-3">Drakenei</option>
<option value="-3">Drakengif</option>
<option value="-3">Vleermuisvlegels</option>
</optgroup>
</select>
<input type="submit" name="submit" value="brouwen" />
</form>
<?php
}
?>