Newbie needing help!
I'm trying to develop a shopping list that takes data from a form. The page needs to take the first $HTTP_POST_VARS being the NAME of the submit button to create a product group.
<br><input type='submit' name='Group_A' value='Add To Shopping List'></th></tr>
After this the group is added to a 3 dimensional array (stored as a session variable) - sort of like this
$basket =array($product_group[item #][product_code, number_required])
etc.
I'm looking for a way to shift out the first element of $HTTP_POST_VARS and grab the 'Group_A' bit (key). Put succinctly i guess this means i'm trying to refer explicitly to a key by its position in $HTTP_GET_VARS which is an associative array?
Otherwise I can strip it out as I enumerate through the data in a (excuse my poor pseudo code):
foreach ( $HTTP_GET_VARS as $key=>$value )
{
if (this is the first item) {
Create [Group A from $key]
}else{
add to [GroupA item $key, #=value]
}
}
but this is less elegant I think?
Does this make any sense at all??