PDA

View Full Version : Writing code for a poll


mr2medic
02-02-2007, 05:31 PM
i am trying to design a poll for my unit's website that would be able to have multiple choices and once someone clicks on a choice it then displays the current percentages. i would also like it to have a omments section where people can add comments or suggestions. i understand how to edit existing cod to make things say what i want, but i have no idea on how to start from scratch. i'm thinking if i posted a poll i could get the code and then edit that to what i need it to say. any opinions or suggestions.

davidj
02-02-2007, 06:31 PM
the polls on this forum are written in a server side language called PHP. Even if you view source on this page you wont see any php code because what you are viewing is the results of PHP. The PHP has to finish its job before sending the page code back to the browser

you have to use a server side script for polls to get an accurate result. If you were to use a clientside script like javascript you would have to store the already - voted marker in a cookie and then thats where it falls over because if the cookies were cleared then i would be able to vote again which defeats the object of 1 person 1 vote.

so its PHP, a good book, this forum (and video tutorials) and a few hours to get the basics down

make sure you understand the basics of core web development before dipping your toe in the water of PHP