| 1 | Dan Cardamore |
|---|
| 2 | dan@hld.ca |
|---|
| 3 | -------------------------------------------------------------------------------- |
|---|
| 4 | Pollerizer CGI - Version 1.0 |
|---|
| 5 | |
|---|
| 6 | This program adds a vote/poll functionality to your webpage dynamically. It allows only one vote per IP, ensuring that the results aren't just from double-voters. It will show the user a question if they have not voted. Once they have voted, it will then show them the results from then on. It also provides a nice bar graph output. |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | This program is distributed under the GNU GPL which is provided as part of the archive. |
|---|
| 10 | |
|---|
| 11 | -------------------------------------------------------------------------------- |
|---|
| 12 | This perl CGI allows you to add a poll to your website VERY easily. |
|---|
| 13 | |
|---|
| 14 | There are 6 files provided as part of the package: |
|---|
| 15 | COPYING - GNU General Public License |
|---|
| 16 | poll.pl - The actual program |
|---|
| 17 | poll.gif - The picture used to create the bar graph. It is a 1x1 blue |
|---|
| 18 | pixel. |
|---|
| 19 | questions.dat - The file containing the question, and the answers |
|---|
| 20 | remote_ips.dat - The file containing the ips |
|---|
| 21 | results.dat - The Poll results |
|---|
| 22 | |
|---|
| 23 | -------------------------------------------------------------------------------- |
|---|
| 24 | |
|---|
| 25 | Installation: |
|---|
| 26 | |
|---|
| 27 | 1) Edit the poll.pl program: |
|---|
| 28 | - make sure it has the correct path for perl on the first line. You can |
|---|
| 29 | find out where this is by typing "which perl". |
|---|
| 30 | - Edit everything in the "USER CONFIGURATION" Section at the top. Pay |
|---|
| 31 | special attention to keep the "/" the way they are in the examples. |
|---|
| 32 | Trailing "/" can be a problem. |
|---|
| 33 | |
|---|
| 34 | 2) Edit the question file: |
|---|
| 35 | - Open the filename that you specified "$question_file" to be with a |
|---|
| 36 | text editor. |
|---|
| 37 | - The first line should be the number of answers that are allowed. |
|---|
| 38 | For example: 3 answers, put a 3. |
|---|
| 39 | - The second line should be the question you want to ask. For example: |
|---|
| 40 | "What came first" <without the quotation marks> |
|---|
| 41 | - Each line after that has one of the possible answers. For example: |
|---|
| 42 | "The Chicken!!!" <again, without the quotation marks> |
|---|
| 43 | |
|---|
| 44 | 3) Creck the file permissions: |
|---|
| 45 | - Ensure that the files have the correct permissions. The LOG files |
|---|
| 46 | should be writable by everyone. You can do this by typing: |
|---|
| 47 | "chmod +w *.dat" in the directory with the log files. |
|---|
| 48 | - Ensure that the poll.pl script is executable. To do this type: |
|---|
| 49 | "chmod +x *.pl" in the directory with the cgi script. |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | THATS IT!!! Now you just have to add it to your webpage. Its very easy to do. Just make sure your webpage has a .shtml extension so that it can do Server Side Includes (SSI). |
|---|
| 53 | |
|---|
| 54 | Then just add this text where you want to include the poll: |
|---|
| 55 | <!--#exec cmd="/home/httpd/html/index/poll/poll.pl"--> |
|---|
| 56 | Make sure that it is the correct path. |
|---|
| 57 | |
|---|
| 58 | If you have any questions, just e-mail me at dan@novas.cx |
|---|