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:
Trouble with formula.db (1997)
Next (1997)
FW: The DNAForum Registration Confirmation (2002)
triggers.db (1999)
WebDNA 5.0 freeBSD?!!? (2003)
Price Not Appearing (2000)
Emailer help....! (1997)
Shipping Calculation Problem (1997)
target=_blank and form variables (1997)
[WebDNA] How to get a screen size (2009)
Re:Emailer setup (1997)
Pithy questions on webcommerce & siteedit (1997)
Multiple Stores and WebCatalog Prefs (1997)
all records returned. (1997)
Running 2 two WebCatalog.acgi's (1996)
WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)
RE: Signal Raised (1997)
show all problem (1997)
WebCatalog can't find database (1997)
[WebDNA] [ipaddress] - [RealIP] - Not working properly (2016)