Build a Perl/CGI Voting System
By Allan Peda2005-07-05
Details: Is GET harmful?
Browsers can maintain state by transferring data to referred pages using the
GET and POST methods, as well as through cookie information contained within the headers passed to the server. In order to confirm that a ballot was sent from a real person (or at least from an active e-mail account), draft ballots would be sent to an e-mail address for confirmation. Additionally, cc: or bcc: messages could be used later for reference. As I mentioned earlier, the most straightforward way to accomplish this is to send an HTTP GET structured link to the voter. Still, some authors claim that GETs that update records are simply bad form. In this case, though, any user subsequently clicking on a link will simply receive an update as to the current tally of votes for each candidate, so no harm is done.
Tutorial Pages:
» Using locked DBM files with CGI-driven forms saves client data without DBMS overkill
» CGI considerations: Simplicity vs. complexity
» Functional design considerations
» Details: Hash keys
» Details: E-mail gotchas
» Details: Not-so-secret ballots
» Details: File layout
» Details: Static vs. dynamic DNS
» Details: Is GET harmful?
» Other possible improvements
» Conclusion
» Resources
First published by IBM DeveloperWorks
| Related Tutorials: » Random subroutines in Perl » Log Script Use » Creating Perl Modules for Web Sites » Bit Vector, Using Perl Vec » Perl Range Operator » Creating Perl Modules for Websites |
