Solution to Back button

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 27290
interpreted = N
texte = I was in the midst of rewriting some of my pages and came across a solution a few of you might be interested in. Over the past few months there has been some discussions of how to avoid the problems that are caused by users hitting the back button. This can cause the shopping cart to contain two of the last item ordered.I've been incorporating the rn=[random][random][random] solution to avoid other problems with browser caches and I think I've found a way to use this number to avoid the back problems.Try this out (this code is on my shopping cart page): [showif [action]=Add] [text]oldRandom=[orderfile cart=[cart]][header20][/orderfile][/text] [hideif [oldRandom]=[rn]] [addlineitem cart=[cart]&db=^Editions.db&sku=[SKU]]quantity=[qty][/addlineitem] [SetHeader cart=[cart]&db=^editions.db]Header20=[rn][/SetHeader] [/hideif] [/showif] Set a variable oldRandom to the value of Header20 (or any other unused header). Then test to make sure that the current value of rn (my random variable) is not equal to the value of the header. Then add your line item and set the header to the current value of rn.Then if the user hits the back button or reloads the page the item will not be added to the cart a second time since the header20 and rn values will be equal.Anyway I thought some of you might find this useful.Thanks for listening. Sam Lewis, V.P. TechnologyTehabi Books http://www.tehabi.com/ 1201 Camino Del Mar, Suite 100, Del Mar, CA 92014 Tel: 626-852-0956 Fax: 916-404-5698 mailto:Sam@tehabi.comGet FREE Electronic Postcards at http://www.tehabi.com/postcards/------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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 Associated Messages, from the most recent to the oldest:

    
  1. Solution to Back button (Sam Lewis 2000)
I was in the midst of rewriting some of my pages and came across a solution a few of you might be interested in. Over the past few months there has been some discussions of how to avoid the problems that are caused by users hitting the back button. This can cause the shopping cart to contain two of the last item ordered.I've been incorporating the rn=[random][random][random] solution to avoid other problems with browser caches and I think I've found a way to use this number to avoid the back problems.Try this out (this code is on my shopping cart page): [showif [action]=Add] [text]oldRandom=[orderfile cart=[cart]][header20][/orderfile][/text] [hideif [oldRandom]=[rn]] [addlineitem cart=[cart]&db=^Editions.db&sku=[SKU]]quantity=[qty][/addlineitem] [SetHeader cart=[cart]&db=^editions.db]Header20=[rn][/SetHeader] [/hideif] [/showif] Set a variable oldRandom to the value of Header20 (or any other unused header). Then test to make sure that the current value of rn (my random variable) is not equal to the value of the header. Then add your line item and set the header to the current value of rn.Then if the user hits the back button or reloads the page the item will not be added to the cart a second time since the header20 and rn values will be equal.Anyway I thought some of you might find this useful.Thanks for listening. Sam Lewis, V.P. TechnologyTehabi Books http://www.tehabi.com/ 1201 Camino Del Mar, Suite 100, Del Mar, CA 92014 Tel: 626-852-0956 Fax: 916-404-5698 mailto:Sam@tehabi.comGet FREE Electronic Postcards at http://www.tehabi.com/postcards/------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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 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:

Running _every_ page through WebCat-error.html (1997) SetHeader context (1998) Country & Ship-to address & other fields ? (1997) Mac: LModelDirector bug fix (1997) Authorize net woes (2003) 2.01 upgrade problems (1997) transferring values (1998) OS X (2000) RAM variables (1997) Major bug report on rootbeer (1997) problems with 2 tags (1997) ODBC and WebCatalog on Solaris and talking to a Sybase database (2001) [WebDNA] Range calculation w/negative values (2011) [WebDNA] Search Site (2009) taxTotal, grandTotal (1997) Web Catalog vs. ICAT (1997) formatting a number (1999) more info on [setlineitems] (1997) WebDNA vs SQL ? (2002) WebCatalog/Mac 2.1b2 New Features (1997)