help calculating total from option boxes
Posted: Mon Oct 20, 2008 4:42 am
I have 3 option boxes
And need to calculate totals based on one of the options selected. Trouble is I think my if statements are not written correctly. Can anyone advise here is the code that calcultes the option boxes from my database
Code: Select all
echo 'Load from 14m3 - 20m3' . "<label><input type='radio' name='load' value='luton'</label>"."<BR>";
echo 'Load from 7m3 - 14m3'."<label><input type='radio' name='load' value='full_load'</label>"."<BR>";
echo 'Load from 1m3 - 7m3' . "<label><input type='radio' name='load' value='half_load'</label>"."<BR>";
Code: Select all
if ($load == 'full_load') {
$total = $row['full_price'];
}
if ($load == 'half_price') {
$total = $row['half_price'];
}
if ($load == 'luton') {
$total = $row['luton'];
}