I am new to php and have been trying to enable the website I am working on, to correctly calculate the price of two factors on a reservation page for a restaurant (party size & VIP area selection). Currently I have implemented javascript calculations so that on the reservation page a total price is displayed automatically once the user makes their selections, however I wish for the confirmation php page which is displayed once the reservations form has been submitted, to perform the calculations on the server side.
Here is the html code in question (reservations.html):
<strong>Select Party Size:</strong>
<br>
<select name="party" id="party" onblur="validateSelect(name)">
<option value="">Please Select</option>
<option value="5 (+£5)">1 Person (£5)</option>
<option value="10 (+£10)">2 People (£10)</option>
<option value="15 (+£15)">3 People (£15)</option>
<option value="20 (+£20)">4 People (£20)</option>
<option value="25 (+£25)">5 People (£25)</option>
<option value="30 (+£30)">6 People (£30)</option>
<option value="35 (+£35)">7 People (£35)</option>
<option value="40 (+£40)">8 People (£40)</option>
<option value="45 (+£45)">9 People (£45)</option>
<option value="50 (+£50)">10+ People (£50)</option>
</select>
...
<strong> VIP Area? </strong>
<br>
Yes (+£5) <input name="hand" id="left" value="5 (+£5)" onblur="validateRadio(id)" type="radio">
No <input name="hand" id="right" value="0" onblur="validateRadio(id)" checked="" type="radio">
<span class="validateError" id="handError" style="display: none;">Please specify whether you would like a table in the VIP area.</span>
Here is the php code I currently have which is not fully functioning (confirmation.php):
<b>Total Reservation Costs: </b>
<?php $party + $hand
If anyone knows how I can correct my php code to perform the calculations of the party and VIP area selections and display this on the confirmation php page, I would be appreciative for any suggestions.
Thank you