Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Browser Back Button Issues

Posted on 2013-11-16
3
Medium Priority
?
366 Views
Last Modified: 2013-11-16
Hello,

Please do this:

(1) Go to tchristy.net.

(2) Enter the term "Sprayer" (without the quotes) into the search filed, upper right.

(3) Click Search.

(4) It produces a page with three items.

(5) Click the middle item (4 1/2 Gallon Back Pack Sprayer).

(6) On the detail page, click the browser back button. You get "Document Expired" in Firefox (not sure in other browsers).

The customer expects the "back" button to go back to the search page.

Of course all this is dynamically generated out of a database. I understand the back button issues.

Can I get control of the back button (in Javascript) and, in effect, return to the search page? I can of course save the search string in a session variable, etc.

I know there are messy issues trying to "control" the back button.
0
Comment
Question by:Richard Korts
3 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 39653737
Line 67 of the generated HTML contains this:

<form method="post" id="searchform" action="product_search.php">

The POST method is inappropriate for requests that do not change the state of the data model.  If you change to use GET, you'll avoid this issue and your clients will be able to bookmark the pages, send links to friends, etc.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 39653810
I don't think this is a back button problem.  While I don't believe that you will get what you are looking for, it also looks like you have put up 'cache prevention' code on that page.  On my pages similar to this, I at least get the main page without the previous results.  Ray's suggestion of using GET which puts the seaarch request in a URL query string may solve the problem also.
0
 

Author Closing Comment

by:Richard Korts
ID: 39653892
Works like a charm. I don't know why, but hey.................
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question