Hi. I've got a problem(don't we all?):
I've got a shop where you store all your items as well as the prices in a text file. I got some help on displaying all the items in the shop next to checkboxes, but now I'm baffled by the next part. When you select the items you want and then submit, you should be shown a list of the items you selected(not all the items in the shop and also not nothing - this is what I've been getting)as well the total cost of it all.
The code I use to display all the items in the shop next to checkboxes looks like this:
{
print("<form method=post>");
print("Select the items you want<br><br>");
$f = file($afile);
foreach ($f as $key=>$val)
{
$entry = explode(",",$val);
foreach ($entry as $key2=>$val2)
{
$tmp=explode("-",$val2);
$item = $tmp[0];
$price = $tmp[1];
if ($item)
{
print("<input type=checkbox name=$item> $item R
".number_format($price,2)."<br>");
}
}
}
print("<input type=submit name=submit value=Submit>
<input type=hidden name=action value=checkout>
</form>");
}
Can someone please help me with the next part where you are shown what you've purchased and the total cost?
Thanks