So what I'm trying to do is create a shopping cart webpage that takes information from a csv file and then generates the webpage using the information from the csv file. In this csv file, there is the price of the item, how much is in stock, and the picture of the item. The code below is able to generate all of this and this is a screenshot of what I have so far: https://gyazo.com/2f14eff68d156cd6d9cb93fd66418760
Now I want to have "order" buttons beneath each item. I am having trouble understanding how I can generate an order button for each item and make each order button unique. I know I need to make this order button submit information for that specific 'container' and not information of the orders but I'm not sure how to make each item unique. Sorry if these questions are elementary. I'm not very experienced with php.
if (($handle = fopen("assign6.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
echo "<div id = 'container'>
<figure>
<p style='float: right; font-size: 20pt; text-align: center; width: 20%; margin-right: 10%; margin-bottom: 0.30em;'>
<img src=$data[2] height = '200' width = '200' ><br>$data[1]<br>Stock: $data[3]<br>$$data[4] </p>
</div>
</figure>";
}
fclose($handle); }