PHP Checkboxes Values
<p>I have the following forms in my buy.php page. This page submits to the checkout.php page.</p>

<pre><code>Burger $4.99  &lt;input type="checkbox" name="foods[]" value="burger"/&gt;
Fries  $2.49  &lt;input type="checkbox" name="foods[]" value="fries" /&gt;
Pizza  $10.99 &lt;input type="checkbox" name="foods[]" value="pizza" /&gt;
Steak  $15.59 &lt;input type="checkbox" name="foods[]" value="steak" /&gt;
Ribs   $15.99 &lt;input type="checkbox" name="foods[]" value="ribs"  /&gt;

&lt;input type="submit" name="buy" value="Buy Now" /&gt;
</code></pre>

<p>What I wanted to do is that when users presses the Buy Now button, they should be redirected to the checkout.php page which will display the items they bought on the previous page along with the price for each of those items as well as the total of all items. I am able get the value from these input fields by looping through the $_POST['foods'] array which gives the value of each checkbox selected by the user. How would I go about getting the prices of each of the items the user bought so I can calculate and then display the total of those items? Would I have to include more fields? Also, I should mention that I am not yet using database for these pages. Sorry, I'm new to PHP. Any help/suggestions would be greatly appreciated. Thank you.</p>
