Dropdown list and Tables using two file?

Could some show me how to get the dropdown value out of this form using PHP or would you know where I can find a very simple example full example. I want to send the selected number to another file (process-order.php) and put it inside a table where calculation is done. I know how to handle the data once it’s in there but i I don’t know how to create the file to accept data.


<html><head><title>Order Form</title>
</head><body><h1>Order Form</h1>
<center><br>
<!--   .............................................................   -->

<form action="process-order.php" method="POST">
<table id="my_table" align="center" border="2" cellpadding="4" cellspacing="0">
<thead><tr>
<th>Sam Sandwichs</th>
<th>Cost</th>
<th>Quan</th>
</tr>
</thead>
<tbody>
<tr>

<th>Bulgher Burger</th>
<td>$7.95</td>
<td><select name="bb1">
<option size=30 value="0">0<option value="1">1<option value="2">2<option value="3">3<option value="4">4<option value="5">5<option value="6">6<option value="7">7<option value="8">8<option value="9">9<option value="10">10</select></td>
</tr>

<th>Club Sandwich</th>
<td>$7.95</td>
<td><select name="bb2"><option size=30 value="0">0<option value="1">1<option value="2">2<option value="3">3<option value="4">4<option value="5">5<option value="6">6<option value="7">7<option value="8">8<option value="9">9<option value="10">10</select></td>
</tr>

<th>Cheesesteak</th>
<td>$7.95</td>
<td><select name="bb3"><option size=30 value="0">0<option value="1">1<option value="2">2<option value="3">3<option value="4">4<option value="5">5<option value="6">6<option value="7">7<option value="8">8<option value="9">9<option value="10">10</select></td>
</tr>

<th>Crisp Sandwich</th>
<td>$7.95</td>
<td><select name="bb4"><option size=30 value="0">0<option value="1">1<option value="2">2<option value="3">3<option value="4">4<option value="5">5<option value="6">6<option value="7">7<option value="8">8<option value="9">9<option value="10">10</select></td>
</tr>

<th>Cuban Sandwich</th>
<td>$7.95</td>
<td><select name="bb5"><option size=30 value="0">0<option value="1">1<option value="2">2<option value="3">3<option value="4">4<option value="5">5<option value="6">6<option value="7">7<option value="8">8<option value="9">9<option value="10">10</select></td>
</tr>

<th>Dagwood Sandwich</th>
<td>$7.95</td>
<td><select name="bb6"><option size=30 value="0">0<option value="1">1<option value="2">2<option value="3">3<option value="4">4<option value="5">5<option value="6">6<option value="7">7<option value="8">8<option value="9">9<option value="10">10</select></td>
</tr>

<tr>
<th>Cucumber Sandwich</th>
<td>$7.95</td>
<td><select name="bb7"><option size=30 value="0">0<option value="1">1<option value="2">2<option value="3">3<option value="4">4<option value="5">5<option value="6">6<option value="7">7<option value="8">8<option value="9">9<option value="10">10</select></td>
</tr>
</tbody></table>
<p>
<button type="submit">Order</button>
</p>
</form>

</center>
</BODY>
</HTML>

<!--   .............................................................   -->
<!--   .........................  HTML  .............................  -->
<!--   .............................................................   -->

</body>
</html>

Thanks in advance

In the first instance you won’t get anything correctly as you aren’t closing off your <option> tags in any of the menu options (plus you can’t use size in menus). It should be:


<td><select name="bb1"><option value="0">0</option><option value="1">1</option><option value="2">2</option>.....<option value="10">10</option></select></td></tr>

Then on your process_order.php page you just need to use $_POST[‘bb1’] etc (for each select name) to get the value that has been selected and posted through the form.

Now it’s Working!!! Thanks a ton chilli11you just saved my world.

Not a problem - you sometimes need an extra pair of fresh eyes to find simple problems :slight_smile: