On Thu, 12 Feb 2004 21:44:50 GMT, in comp.lang.javascript "Ken"
<kk******@wi.rr.com> wrote:
| This is a challenge. Perhaps someone can offer suggestions.
|
| I am trying to create a variable, ordernumber, that increases by an
| increment of 1 every time the variable is accessed.
|
| For example:
| Call up the variable the first time: ordernumber = 1
|
| "Reopen" the webpage, call up the variable a second time: ordernumber = 2,
| etc.
|
| I am trying to create sequential order numbers without using the date or the
| alphabet. I would like the order number to be a max of 6 numeric digits.
|
| The problem I am having is finding a way for the ordernumber to be
| remembered on the server, so when I call it up the next time, it can be
| incremented by 1.
|
| Thanks for the thoughts.
You shouldn't rely on the web page to hold such information.
Reason 1: if I click on the back/forward buttons on the browser this
will alter the number on not reflect the 'true' value to store.
Reason 2: if 20 people access the page at the same time then they will
all be given the same number. When then store their information then
they might end up with the same order number.
Let your database handle this auto-incrementing number.
---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------