Limit voter to only 1 vote on OnlinePolling system using cookies
Limit voter to 1 vote only on OnlinePoll using cookies
I've created an online polling system, using a simple radio button Form with a get method of "Post" The voter simply makes their selection, then clicks on SUBMIT.
I took a crash course in CGI so I'm fairly new at this. Anyway, my polling system consists of 4 files:
1) Poll.html (the actual form)
When a user clicks on the SUBMIT button from Poll.html, this CGI is then called.
If user made a selection then this CGI prints out a message, "Thank you for your vote,you voted for 'John Doe' for Instructor of the year!" Click here to view current Poll results. The selection is then appended to a text file called votes.txt via the
open (FILE, ">> votes.txt");
print FILE, "$Instructor\n";
If user didn't make a selection, an error
message is displayed asking user to
return to Poll.html by clicking on
BACK button and make a vote.
This tallies all the votes for each nominee.
This is not actual code... I actually used an array for each and used a foreach loop in my script, this example is for the purpose of demonstrating how I computed the barwidth.