Im pretty new into PHP and Im trying to calculate the quantity written inside the input (quantity) My code looks like this:
<tr>
<td>Antal:</td>
<td><input type="number" name="quantity" value=" "></td>
</tr>
<tr>
<td>Styck à pris 110 kr</td>
<td><input type=submit></td>
</tr>
and the php:
<?php
if(isset($_POST['quantity']) && $_POST['quantity'] == 1){
$antalBiljetter = $_POST['quantity'];
$isSubmit = 1;
$total = $antalBiljetter*110;
echo "<br>Totalpris för" .$antalBiljetter['quantity']. " är " .$total;
}else{
$isSubmit = 0;
echo "<br>Gå tillbaka och välj antal biljetter.";
}
?>
So what i would like to output is quantity * 110.
What am I doing wrong because it is not calculating? Thanks in advance!
Ps. Im using POST method on my form.