recording votes

U

user99

my page has a drop down with names which
people can vote for. any ideas on how
i can record the individual count of
votes for each name. i'm thinking about
using a text file to store the names with
the vote count and incrementing the counts
and then write them back to the same file.

any better ideas????
 
R

Robin

user99 said:
my page has a drop down with names which
people can vote for. any ideas on how
i can record the individual count of
votes for each name. i'm thinking about
using a text file to store the names with
the vote count and incrementing the counts
and then write them back to the same file.

any better ideas????

your way is how I did it for my poll unless your planning to use a database,
this seems like the best option to me....remember not to make your vote
files
world readable.
-Robin
 
M

Matt Garrish

Robin said:
your way is how I did it for my poll unless your planning to use a database,
this seems like the best option to me....remember not to make your vote
files
world readable.

Care to share what steps you took to ensure that multiple instances of your
script aren't trying to read and write to the file at the same time?

Matt
 
B

Bill

user99 said:
my page has a drop down with names which
people can vote for. any ideas on how
i can record the individual count of
votes for each name. i'm thinking about
using a text file to store the names with
the vote count and incrementing the counts
and then write them back to the same file.

any better ideas????
It's not perfect, but look at http://www.datacomm.ch/atair/perlscript/
 
R

Robin

Matt Garrish said:
Care to share what steps you took to ensure that multiple instances of your
script aren't trying to read and write to the file at the same time?

None yet, but actually at this moment I'm learning about file locking and
open() checking...later,
-Robin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top