I have a table with pizza name, pizza type and price. I used a loop to print all the items in a table.
<form method="Cart.php" method="post">
<table border="1" cellpadding="10">
<tr>
<th>Pizza name</th>
<th>Pizza type</th>
<th>Price</th>
</tr>
<?php
while($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['subcat_name'] . "</td>";
echo "<td>" . $row['cat_name'] . "</td>";
echo "<td>" . $row['price']. "</td>";
echo "<td><input type=\"checkbox\" name=\"checkbox\" value=\"\" id=\"checkbox\"></td>";
echo "</tr>";
}
echo "</table>";
?>
<input type="submit" name="addToCart" id="addToCart"/>
</form>
Now I want to access the pizza names and prices as I click the submit button.