<td>Korting: <br>
<input type="checkbox" name="student" value="15">Student 15%<br>
<input type="checkbox" name="senior" value="10">Senior 10%<br>
<input type="checkbox" name="klant" value="5">Klant 5%<br>
<hr>
</td>
</tr>
<tr>
<td>
<input type="submit" width="300px" name="submit" value="Bestellen">
<hr>
</td>
</tr>
</form>
</table>
<!--Shoppingcart eindigt hier-->
<?php
if(isset($_POST['submit'])){
$aantal = $_POST['aantal'][0];
echo "Aantal is: ".$aantal."<br>";
if(isset($_POST['student'])){
$korting = 15;
echo "Korting is $korting procent";
} if(isset($_POST['senior'])){
$korting = 10;
echo "Korting is $korting procent";
} if(isset($_POST['klant'])){
$korting = 5;
echo "Korting is $korting procent";
}
}
?>
</body>
When I select 2 checkboxes, I want the discounts to be summed. For example: When I select Student and Senior, I want the echo text to be 25, instead of 15 and 10 separate. What do I need to do?