I am doing a little learning on php and and html using smarty to aid it.
I am trying to build a very simple shop-alike list with a cart image that when it is clicked, it is supposed to return via form the info I want from that item, but I am failing to get the index of the items right....
This is the code relative to the loop inside the tlp (it is a HTML internally used by smarty):
{section name=i loop=$homeList}
{/section}
and this is the code relative to the "experimental" php update:
require_once("functions.php");
var_dump($_POST);
and this is a sample var_dump output:
array
'usr' =>
array
0 => string 'abobora' (length=7)
1 => string 'abobora' (length=7)
2 => string 'abobora' (length=7)
3 => string 'abobora' (length=7)
4 => string 'abobora' (length=7)
'iditem' =>
array
0 => string 'it10' (length=4)
1 => string 'it13' (length=4)
2 => string 'it2' (length=3)
3 => string 'it20' (length=4)
4 => string 'it21' (length=4)
'qta' => string '1' (length=1)
'index' => string '1' (length=1)
'submit_x' => string '22' (length=2)
'submit_y' => string '27' (length=2)
The thing is: how do I tell the form that a single button has a singular index to the array and gain access to the correct info inside the array?
PS: the index="1" here is just an experimental value, what I wanted there is the info relative to the index
PSS: sorry for the bad output format, but there are times that I simply don't get how code tag works....