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:

Word wrapping (1997) Problems with [Applescript] (1997) Setting up shop (1997) WCS Newbie question (1997) PIXO support (1997) (2004) [WebDNA] Upper ASCII and charset [OT] (2016) Sorting by date (1997) WebCat2 several catalogs? (1997) Question from a Neebie (2000) Still Pulling my hair out (2001) [WriteFile] problems (1997) WCS Newbie question (1997) Protect tag for large groups? (1999) Mauthonly followed by mauthcapture (2002) [WebDNA] Processor Maxing out (2010) RequiredFields (2000) problem: mail changed (1997) Request for help on a new *automated* WebCatalog function ... (1998) Almost a there but..bye bye NetCloak (1997)