Solved

Browser Back Button Issues

Posted on 2013-11-16
3
341 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 109

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

832 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