Your first page doesn't have that loop.
On the second page, keep the inputs that you already have, and add this loop which will write hidden fields for all the inputs from the first page.
The third page will again have the inputs you already have plus this loop again, which will now write hidden fields for all the inputs posted from the second page (the displayed ones plus the hidden ones from the first page).
When the third page is posted it should have all the inputs from all three pages, unless the user skipped a page.