this is for an e-commerce site but can be applied to elsewhere as well. i'm absolutly sure there's a better way, but cannot find it.
i have a product page, add-to-cart button calls the same page, gets an action-flag (1 = add to cart) and i that producted to a session kept Object stream (serialzed)
my problem has to do with the back button. :'(
here's the issue, if i use GET (ie productPage.php?pageAction=1&etc..") then when i click the back button, it re-excutes that URL (and thus the product gets re-added to the order object stream.
if i use POST , when i click back, i get a Page Not Found 404 or Page Has Expired. (which on refresh will again re-add the product to the order).
the solution i've found is to use a "processing" page. this processing page changes the "header" , so it never gets loaded into the browser's history, but i simply cannot have that. i'm passing other stuff (like message = "your product has been successfully added" for example) which i don't want to use header (Locaton: page.php?message=) ;
there's got to be a better way to this kind of processing,how do the big guys do it, eBay, Amazon. ???
any pointers and directions will be greatly appreciated,
please let me know if you need more info about my code/setup.
-Dan Murad