in reply to simple voting script
An important question is; what happens if two people hit submit at the same time? Do you have any locking scheme to prevent two instances from overwriting or corrupting the data files?
What about using a database, such that you can make a single transaction out of "delete name from pending votes, and increment vote tally for candidate A, B, C". Then you don't need to record how they voted, you're protected from simultaneous access, and they can't lose their vote or vote twice.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: simple voting script
by friar tux (Novice) on Apr 27, 2011 at 22:13 UTC | |
by ww (Archbishop) on Apr 27, 2011 at 22:42 UTC | |
by JavaFan (Canon) on Apr 28, 2011 at 10:52 UTC | |
by Anonymous Monk on Apr 28, 2011 at 13:39 UTC |