Results 1 to 1 of 1
Apr 15, 2001, 22:49 #1
- Join Date
- Mar 2001
- Melbourne, Australia
- 0 Post(s)
- 0 Thread(s)
Here's my problem:
I've got a PHP script (let's call it summary.php) that allows the user to build a complex SQL statement based on their check box and drop-down box selections. When they click on the 'Go' button, summary.php calls itself and displays the results of the query beneath the check/drop-down box panel. The information being displayed is summary info from the MySQL database. The user then clicks on one of the summary items, and another script (let's call it detail.php) runs and displays the detail record.
Great. So far so good. But now I want to provide the user with a button so that they can return to the summary display page - but without the (potentially long/complex) database query having to run again.
<INPUT type="button" value="Back To Summary" onClick="history.back()">
then my browser complains that the page has expired, do I want to repost the data, blah, blah, and then re-runs the query to produce the summary list.
Now, if I change the POST to a GET in summary.php for the form which generate the SQL query, then I don't get the above error message, but the original SQL query still has to re-run in order to re-generate the summary list.
The possible solutions that I can think of are:
1. Display the detail page in a new browser window, or
2. As the results of the query in summary.php are generated, store the record IDs in a temporary table along with the session id of the user. Then, when the user clicks to go back from the detail to the summary page, run a slightly different routine which picks up the summary record IDs from the temp table and re-displays the summary list.
Either of these solutions are 'OK', but not really what I want. What I really want is for the user to be able to click 'Back' to return to the summary list without browser warnings or query re-runs.
Can anyone improve on my suggestion solutions?