I think you better use javascript,or javascript with
PHP (
AJAX).
If you use javascript,there are two ways:
1: output all your fields and just display one of them,and use 'style="display:none"'
CSS to hidden other fields,when user click on "add another set" just use javascript to make it display example:document.getElementById('doc'+div).style.d isplay = 'block';
2:use javascript to add a new field like this:
document.getElementById('attach_' + total).innerHTML = "<input type='file' size='60' name='theFile[]' />"
Hope it will help you.