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.

My problem is some visitors click on the BACK button and make multiple votes. I've been able to track the users IP Address,Remote Host name and time/date stamp via CGI script. So I can tell pretty much who are the flying voters. So I just delete the excess votes, but that can be a hassle if they vote abt 50 times. Is there a way to use cookies to store the voters selection and prevent them from using my Poll.html to vote over and over again?

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)

2) Poll.cgi
  • 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
  • Code:
         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.


3) Poll_results.cgi
  • 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.
    Code:
     
       ex: $Totalvotes = 200
           $JDvotes  = 100
           $Janevotes= 22
           $BDvotes = 38
           $BSvotes = 40
    
           $JDbarwidth= $JDvotes/$Totalvotes

    and create a bar graph using the number
    of votes for each one as the table width.

Code:
 
    ex:
    <table>
        <tr> 
           <td width = $JDbarwidth bgcolor=Blue>
             |
           </td>
           <td>
             $JDbarwidth\%
           </td>
        </tr>         

   ex: John Doe       ||||||||||| 50%
         Jane Doe      ||| 11%
         Ben Dover     |||| 19%
         Bart Simpson ||||| 20%
Click here to see the actual result

4) voters.txt
  • Consist of data saved via CGI's append to file.

    Each line appended/saved is the Voters selection, IP address of voter,date/time stamp per line. (\n)


Is there a way to use cookies to store the voters selection and prevent them from using my Poll.html to vote over and over again?

Thanks in advance for any help you can provide.