[thelist] asp experts? 2 things...

Liz Lawson lizlawson at charitycards.co.uk
Wed Oct 4 10:37:38 CDT 2000


>Scenario:
>1) You search for products;
>2) Add a product to your cart;
>3) You are returned to the results page with a confirmation of what you
just
>put in your cart;
>    note: There is nothing selected in this page now - nothing in the
>visible fields/quantity field anyway.
>4) If you refresh that returned page, it will add yet *another* item to
your
>cart.


Refresh resends the last request to the server, which in this case triggers
a script which causes item x to be added to the cart. The server runs the
same script with the same input so you get the same result: item x is added.

My pages are all generated on the fly, so I get around the refresh problem
by including a hidden value "now" in my forms whose value is the time the
page was generated, and saving this as a session variable when the form data
is processed. If a submitted "now" matches a saved "now" I know the page has
been refreshed and drop through to the basket display without acting on the
input.

If your form pages are static html this won't be possible. Maybe you could
save the form input in your session and check for an exact match before you
act on it. (i'm sure there'll be a lot of better suggestions, but you can
see what I'm getting at).

(It's not an access or asp thing, it's just how HTTP servers handle
requests.)

HTH

Liz






More information about the thelist mailing list