I'm using a php script to send SQL data rows to an htm form and then to process some user input on the form. The action of the htm form is to reload the script, which then puts a new input on the htm form for a second user action. The php script drives a three part process: 1) load the data rows in htm, 2) evaluate user input from the htm and send some new array data back to the htm, 3) evaluate different user input related to the added array data. I have logic in the script to determine which part of the process it's working on.
The script is capturing good POST input from the first user submit, and capturing another set of good POST input on their second submit. When the first POST data is processed in a loop, I'm also pushing the post elements into another array, to store it for later use in the script. The problem occurs when the script is in part 3. After the user has submitted the form (loading the script for the third time), the array I created to keep the first POST data is empty. It contains zero elements.
Do arrays get reset when a script is reloaded? Can I somehow cache array contents so they can be referenced after a script is reloaded? Do I have to dump my temporary data back into SQL to use it later?
Or is there a better way to do this kind of back and forth processing? Maybe use multiple <form> components on the htm page? Or process some of the POST data with a function?
I can post some code here if anyone needs to have a look in order to understand what I'm doing.
Thanks!