Advice on adding variations through front-end

I have a front-end form for posting products and it works great. I am now trying to extend it to add variations to a product but I need a little help. I've identified the name of the custom fields that would be needed but I'm not sure how to go about how to add the multiple fields with the same name.

For instance I would need a mp_var_name, but I need one for each variation. an array like mp_var_name[x] has something to do with it but can I name a custom field with the brackets in it.

please advise... any info in any direction is huge thanks!