Hi,
i've a form that submits fields with dynamically generated names. eg. quantity1, quantity2 etc, depending on the number of items being submitted. i need to calculate the total quantity which will be the sum of the values submitted in all of these fields. i'm very new to php (in fact to programming in general - so for all I know I'm going about it totally wrong) but what I've got so far is the following code:
for ($a=1; $a<=$calculate; $a++){
$b = "quantity".$a;
$c = $$b;
}
where $calculate is the number of fields. What i need is to be able to add up all the values of $c
hope someone can help
thanks