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 92014Tel: 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:
|
- 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 92014Tel: 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:
WebCat2b13MacPlugIn - [showif][search][/showif] (1997)
Extended [ConvertChars] (1997)
Help with Shipping Costs (1997)
can WC render sites out? (1997)
Protecting databases (1999)
WC2b12: Yes, Formulas.db is for real (1997)
Browser Problem?!? Still getting Error message usingPOST! (1997)
I can help! (1996)
[WebDNA] Ubuntu 14.04 & WebDNA (2017)
PCS Frames-Default page is solution! (1997)
Mozilla/4. and Browser Info.txt (1997)
emailer (1997)
Great product and great job ! (1997)
Out of the woodwork (2007)
ShowPage error (1998)
syntax question, not in online refernce (1997)
wc 2 pro users - sites, quotes wanted (1997)
showing *all* name/value pairs with [search] (2003)
Nested tags count question (1997)
expired beta (1997)