Q:

Select list with price value and name

I have a form that works great with a review stage. What I want to do is not add a price to mix. Say I have a dropdown like this
<select name="DriverShaft" class="select">
  <option value="" selected="selected">Select Shaft</option>
  <option value="LE- light weight graphite weakest flex">LE- light weight graphite weakest flex</option>
  <option value="LW- Light weight graphite weak flex">LW- Light weight graphite weak flex</option>
  <option value="LM- Light weight graphite medium flex">LM- Light weight graphite medium flex</option>
  <option value="LR- Light weight graphite regular flex">LR- Light weight graphite regular flex</option>
  <option value="GR- Medium weight graphite regular flex">GR- Medium weight graphite regular flex</option>
  <option value="SS- Light weight graphite stiff flex">SS- Light weight graphite stiff flex (low torque)</option>
  <option value="TS- Medium weight graphite stiff flex">TS- Medium weight graphite stiff flex</option>
  <option value="SX- Light weight graphite X-stiff">SX- Light weight graphite X-stiff</option>
  <option value="KS- Light weight steel stiff flex">KS- Light weight steel stiff flex</option>
  <option value="KR- Light weight steel regular flex">KR- Light weight steel regular flex</option>
  <option value="DX- Heavy weight steel extra stiff">DX- Heavy weight steel extra stiff</option>
  <option value="DS- Heavy weight steel stiff flex">DS- Heavy weight steel stiff flex</option>
</select>

and on the review I echo the option like so:
echo (!empty($_REQUEST['DriverShaft'])) ? "<div class='reviewItem'><span class='reviewTitle'>Shaft:</span>{$_REQUEST['DriverShaft']}</div>" : "";

This would then show me the shaft select if they chose one. How do I add a price value to each shaft though? So on the review it shows the name of the shaft but I can also get a price from their selection to add up?

A:

Set only value= with price seperated by : or any other char
value="LE- light weight:50.25">LE- light weight</option>

and on the review echo the option like so:
if (!empty($_REQUEST['DriverShaft'])) {
   list($shaft, $price) = explode(":", $_REQUEST['DriverShaft']);
   echo "<div class='reviewItem'><span class='reviewTitle'>Shaft:</span>{$shaft}</div>";
   echo "<div class='reviewItem'><span class='reviewTitle'>Price:</span>{$price}</div>";
} else echo "";

If you want that nobody can see the price not even in html sorce text
add the ID of the DB table where the price is stored 
value="LE- light weight:12">LE- light weight</option>

a database query is needed
if (!empty($_REQUEST['DriverShaft'])) {
   list($shaft, $IDprice) = explode(":", $_REQUEST['DriverShaft']);
   if (!empty($IDprice)) {
     // your database logic
      $sql ="SELECT price .... WHERE priceid=:prid";
      ....
     // logic end
   $price = $row['price']; 
   } else $price = "n/a";
     echo "<div class='reviewItem'><span class='reviewTitle'>Shaft:</span>{$shaft}</div>";
     echo "<div class='reviewItem'><span class='reviewTitle'>Price:</span>{$price}</div>";

} else echo "";

