|
|
[ Online Survey - Reference ]
The Online Survey lets visitors to your page vote in a survey of your
choice.
Template files used by this Dynamic Tool
Options available:
Online Survey SetupUse the following HTML hyperlink to link to your online survey:
Use this HTML hyperlink to display the results of your survey:
Editing your Online Survey resultsThe results from your online survey are stored in the "vote.txt" file hidden in the "_zisp_" folder in your website.You change these results by downloading this file, editing it and then uploading it again. You can download the file from your web browser, by accessing the following page and saving the results as "vote.txt" on your home computer:
You will need to replace "www.mysite.com" with the name of your own web site. The file will contain the current results of your survey. Each line contains a key (the category value in the survey), a colon (":"), a space and then the number of votes for that category:
You can edit this file (for example, using Notepad). Save it and upload it back to your web site, replacing the existing file. You can also reset the survey to zero by deleting the file from your website. Dynamic Tools will create a fresh "votes.txt" file the next time your web page is accessed. Customising your Online Survey using TemplatesThe Online Survey Dynamic Tool uses three template files to generate the pages your visitors see.
Template files should be stored on your website, in a folder called
"easyzisp".
When a visitor clicks on your "/zisp/vote" link they will see a page generated from the "vote.html" template:
This template must contain a form with the following parameters:
This form must contain a form element named "CATEGORY" and a submit button. The "CATEGORY" element can be either a radio box (as in the example above) or a select list:
The value of the "CATEGORY" element is used to identify what the user has voted for, and is recorded in the "votes.txt" file.
You can change the subject of the survey from "colors"
to anything else. You just need to change the values for each option
of the "CATEGORY" form element.
When the visitor to your site submits a vote, the Online Survey Dynamic Tool generates an acknowledgement page from the "v_ack.html" template file.
If you don't want to show an acknowledgement page and would rather go straight to the results page, you can change your v_ack.html template file to simply redirect to the vote_show script. Replace the contents of v_ack.html with the following code:
When a visitor clicks on your "/zisp/vote_show" link they will see a page generated from the "v_view.html" template:
This template generates a page with the results of your survey. It has one special tag: "<!--SURVEY ENTRIES-->". This tag must enclosed inside an HTML table ("<TABLE>" and "</TABLE>"). When the webserver displays this template, it replaces the special "<!--SURVEY ENTRIES-->" tag with the results of your survey. Using multiple Online SurveysYou might want to have several online surveys on different topics. You can do this by giving each separate survey its own "ID".
... and
... where "NN" is a number between 0 and 99. For example, the survey with ID "45" will store its results in the file "vote45.txt" in your "_zisp_" directory. The standard vote.txt file is created automatically, however any extra vote files must be created manually by you before they can be used. Your ISP should provide details on how to do this. Zisp will try to use the templates named "vote45.html", "v_ack45.html" and "v_view45.html" in your "easyzisp" directory, if they exist. For security reasons, you must create the voteNN.txt files yourself. This can be done using a simple text editor like Notepad and uploaded to your website. Your ISP should provide details on how to do this. Additional securityIt is a good idea to ensure that only valid votes are submitted to your survey. In order to help enforce this, you can place a simple file in your "_zisp_" directory. This file must be called "categories.txt" and should contain a list of the valid vote options you want to allow in your survey. Each category should be listed on a separate line as shown below:
Bear in mind that this is entirely optional, and should you not require any vote checking simply remove this file from the "_zisp_" directory. You can add it again at any point. If you are using multiple surveys, you can apply the "ID" system (described in the previous section) to the categories file. In these circumstances you would create a file with the name "categoriesNN.txt" where "NN" is the ID number (between 0 and 99) of your survey. | |||||||||||||||||||||||||||||||||||
![]() |
![]() |