Re: Problems when user hit back
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 34503
interpreted = N
texte = >Could you explain this a bit, Sam?>Sure. The problem was that when someone hits Reload on the shopping cart page or Back from the invoice page it can affect the shopping cart by adding multiple instances of a single sku. So since I am using the rn=[random] trick to solve browser caching issues anyway I also use it to solve this problem.> >[showif [action]=Add]>>> >[text]oldRandom=[orderfile cart=[cart]][header20][/orderfile][/text]When someone adds an item to my shopping cart page I check to see if this request is coming from their cache by comparing the header20 value to the rn value that is passed to the page.> >[hideif [oldRandom]=[rn]]So if the oldRandom=rn then this request is not unique and is probably caused by someone hitting Reload or Back from the invoice page.> >[addlineitem>>cart=[cart]&db=^Editions.db&sku=[SKU]]quantity=[qty][/addlineitem]>>[SetHeader cart=[cart]&db=^editions.db]Header20=[rn][/SetHeader]If it is unique and rn does not equal oldRandom then I go ahead and add the line item to the cart and I set header20 to the current rn value> >[/hideif]> >[/showif]Does that make better sense?-- Sam LewisSamLewis.comTel: 626-852-0956 Fax: 916-404-5698-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
>Could you explain this a bit, Sam?>Sure. The problem was that when someone hits Reload on the shopping cart page or Back from the invoice page it can affect the shopping cart by adding multiple instances of a single sku. So since I am using the rn=[random] trick to solve browser caching issues anyway I also use it to solve this problem.> >[showif [action]=Add]>>> >[text]oldRandom=[orderfile cart=[cart]][header20][/orderfile][/text]When someone adds an item to my shopping cart page I check to see if this request is coming from their cache by comparing the header20 value to the rn value that is passed to the page.> >[hideif [oldRandom]=[rn]]So if the oldRandom=rn then this request is not unique and is probably caused by someone hitting Reload or Back from the invoice page.> >[addlineitem>>cart=[cart]&db=^Editions.db&sku=[SKU]]quantity=[qty][/addlineitem]>>[SetHeader cart=[cart]&db=^editions.db]Header20=[rn][/SetHeader]If it is unique and rn does not equal oldRandom then I go ahead and add the line item to the cart and I set header20 to the current rn value> >[/hideif]> >[/showif]Does that make better sense?-- Sam LewisSamLewis.comTel: 626-852-0956 Fax: 916-404-5698-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Sam Lewis
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Forcing Paragraph Breaks on Results (1998)
WCS Newbie question (1997)
Show items based on login Password (2003)
[WebDNA] Append speed limits (2008)
problems with 2 tags shakur (1997)
Online reference (1997)
bug in [SendMail] (1997)
[WebDNA] Email time bug? YES, it's a bug! (2011)
Banner DNA (1997)
E-Mailer (WebCatb15acgiMac) (1997)
hideifs using [date] (1999)
websitepro/webcat/registry? (1998)
ImageMagick (2005)
Snake Bites (1997)
Generating Report Totals (1997)
possible, WebCat2.0 and checkboxes-restated (1997)
Apache won't load after v5 install (more) (2003)
Forms Search Questions (1997)
Database Upload (2000)
Problems with [Applescript] (1997)