Solved

Browser Back Button Issues

Posted on 2013-11-16
3
345 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 110

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

710 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