Solved

Browser Back Button Issues

Posted on 2013-11-16
3
336 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 108

Accepted Solution

by:
Ray Paseur earned 500 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 83

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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.

914 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now