Chú ý rằng các hình thức hành động trực tuyến được thiết lập để / bỏ phiếu / apps / , vì nó là cần thiết để gọi các ứng dụng phiếu. Ngoài ra, lưu ý rằng mỗi nút bỏ phiếu vô tuyến điện được gọi là "bỏ phiếu" và có một giá trị số (1-4). Điều này là cần thiết để thu thập dữ liệu bỏ phiếu. | Chapter 20 Web Site Tools 707 If you examine the source of this Web form you will notice the following HTML form code form action vote apps target _blank method POST font face Verdana size 1 How do you rate this site p input type radio name vote value 1 Great very informative br input type radio name vote value 2 Good has good info br input type radio name vote value 3 OK needs a bit of improvement br input type radio name vote value 4 Poor needs a lot of improvement p input type submit value Vote input type hidden namie poll_id value 1 font form Notice that the form action line is set to vote apps as it is needed to call the vote application. In addition note that each vote radio button is called vote and has a numeric value 1-4 . This is needed to collect vote data. Finally note a hidden form field called poll_id which is set to 1. This number identifies the form in the file s choicesPerPoll array which is shown here choicesPerPoll array POLL ID 1 2 NUMBER OF CHOICES 4 7 This array in determines the maximum number of options per polling form. Here our Web site polling form poll_id 1 has four options as shown in the aforementioned HTML form so the choicesPerPoll array has the same number specified. Now if you select any of the voting options for the Web site form and click the Vote button your vote will be stored in the VOTES table in the VOTE database. You will be given a cookie so that you cannot vote again until the COOKIE_ EXPIRATION_TIME time specified in expires. As soon as you click the Vote button you will see a pop-up window that shows the current poll results . including your vote . This page is shown using a results template stored in the templates directory DocumentRoot vote apps templates . The name of the template is specific to each poll_id. For example a poll form with poll_id must have a template called in the DocumentRoot vote apps templates directory. Because each poll has its own .