variable persistence in on-rev pages
Martin Koob
mkoob at rogers.com
Mon Nov 29 20:30:20 EST 2010
I am trying to figure out how on an on-rev site to allow a user to view a
file a limited number of times.
I have an on-rev page that when it loads it retrieves a number value from a
data base (ie. 10) and stores it in a variable tCount.
On the page is a form and if the form is submitted the variable tCount is
decremented by one and then stored back in the database.
The next time I submit the form it should retrieve the (now decremented)
variable from the database.
The goal is to have a system where eventually the user will run out their
counter and not be able to submit the form.
However it seems that the value is not always retrieved from the database
and the value of the variable tCount in the script is retained. For example
if the last value of tCount is 5 and I change the value in the database (ie
increase it from 5 to 10) by editing the database directly the next time the
page loads as a result of submitting the form it retains the last value 5
and not the value it should be retrieving from the database, 10.
If I wait a while and try again sometimes it will start using the correct
value from the database. I have tried clearing the cache and that does not
consistently work.
Is this an issue with the browser caching the page? Is the results of the
SQL query being cached and used? Is there a way to ensure that the value
retreived from the database is used?
Thanks for any help.
Martin
--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/variable-persistence-in-on-rev-pages-tp3064723p3064723.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode
mailing list