Jump to content

Help with option boxes, getting results from my database


dthomas31uk

Recommended Posts

Hi guys.  have amended my option boxes had the following and it worked a treat

 

echo 'Full Load'."<label><input type='radio' name='load' value='full_load'</label>";
echo 'Half Load' . "<label><input type='radio' name='load' value='half_load'</label>"."<BR>";

 

which calculated the result as follows

 

if ($load == 'full_load') {
  $total = $row['full_price'];
  
} else {
  $total = $row['half_price'];
  
}

 

However,  I have now added another option box like so

 

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>";

 

but I am having trouble getting the results calculated with the 3 options have tried the following

 

switch($load) {
case "full_load":
$total = $row['full_price'];  
break;
case "half_price":
$total = $row['half_price'];
break;
case "luton":
$total = $row['luton'];
break;
}

 

Any help or advice would be most appreciated

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.