If your familiar with database search results, then you probably know how useful the GET method is. My results page is a list of site members from the database. We want to have a feature that allows users to add these members to a html select box to "save a list of favorites". Every time a user clicks the Add button, the page redirects to itself and we are using session variables to save the list.

Here's the problem with the Browser Back button

1.) Lets say your on page one and you add two members to the list. The GET url will have &list=1,2 appended to the end where 1 and 2 are the two members. The session looks at the variable called "list" and makes an array from the list
2) The user goes to page two of the search results. They add another member. Because the page redirects to itself right after adding to save the added member, the new GET url is &list=1,2,3 The session is resaved with this list
3) The user clicks "BACK". Browsers dont rebuild a dynamic page when you click back so the member that got added in the second page is not present.

How do I solve the back problem?

-Brad

This is what I do to accomplish the task of disabling the cache..
The head tag at the end of the document is important!

<html>
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</head>
<body>
Body stuff
</body>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.