How to tell if the page came up from a refresh

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am making a shopping cart.  I have a catalog page that has a form
for each item and has the shopping cart as the window it goes to on
submit.  It works and the new item is added

problem: if the refrsh button is pushed, my code thinks it is comming
from the catalog and adds the same item.  I treid to use code to get
the referral url, but it seems like it does not count it comming from
a refresh, so it did not work

any idears????
I was thinking about using a session verbole that would get set to a
value if commiong from the catalog, then the shopping cart would clear
it.  This seems a little messey and I'm looking for a more clean


Re: How to tell if the page came up from a refresh escribió:
Quoted text here. Click to load it

The add-to-cart does not need to be visible. Make it do its stuff and
then redirect to anywhere else:


// Add to cart code goes here
// No HTML

header('Location: /');


... where "anywhere else" can be:

- An "Item was added" informative page
- The catalogue page of the product

Quoted text here. Click to load it

Using session variables to do the task of GET/POST parameters only leads
to sites that become unusable as soon as you open more than one tab.

-- - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:
-- Mi web de humor al baño María:

Site Timeline