Hi all
I have a PHP page that contains a simple form (only a couple of options) which submits to the same page; once the options are set and the user has clicked go, it takes about 30 seconds for a LOT of data to be collated and calculated, which is then displayed in a number of tables.
The user can 'drill down' though data in the tables which takes them to different pages. To 'drill back up', they either click back in the browser, or a click a link at the top of the page which will take them back up to the previous page.
Using back prompts the browser to request the form data be resubmitted and the user has to wait another 30 seconds.
Using the link simply reloads the page with the form at the top and no data, so they have to click go again. I can put some $_GET data in the upper URL to auto-complete the form but they still have to resubmit and wait.
I considered storing all the results in a $_SESSION and automatically displaying the page data if it's set, but there are too many different functions and queries on the page to make this practical. I could build an array of results as the page is built and store that in a session instead, but that would be really complicated too.
For the same reason I can't really use a different page to generate the results then use a header redirect to load the page.
What I really want to do is tell the browser to display the page 'as it was' if a session 'flag' is set, for example a simple $_SESSION['alreadyrun']='yes'!
I've tried hiding the form if the flag is set but obviously the browser knows it had to submit a form the last time, so all that does is hide the form - no data is displayed.
Is there a simple way to fix this? I appreciate in the long term it would be better to store all the data in sessions; most of the other pages in my system work that way - but I could do with a simple short term approach!
Thanks