I'm designing a set of forms which have complex content. I'd like the php program that stores the $POST data to a database to return to the form it came from with the variables populated. Is this a common problem?
Approach 1. Use cURL. In the form, make a hidden variable $vnames with a value="name,address,postcode……" corresponding to the input variables required to be saved and reset on re-entry to the program. (there is a hidden variable of the target php program and $SELF) The action is to a php program which parses $vnames, and gets the $POST data, assembling it in format for a CURLOPT_POSTFIELDS entry. Store this in the database unique to the user as a VARCHAR field, then do the whatever the action requires, like putting the variables into the database and checking for errors. Then redirect to the caller through cURL with the postdata in place.
Approach 2 in similar, but retrieve the data from the database early in the execution of each program. Check for the program ID to see if this data belongs to this form, that is to say is it a fresh call, or are we coming back to the same form?