Title: Help with Javascript/HTML
Bob - February 5, 2004 09:46 PM (GMT)
Im trying to make a poll useing Javascript. You should be able to vote and then it opens a new page to show you what percent of people voted for what. kinda like if you do a poll on this forum. Does anyone know how to do it i cant figure it out.
TheHawgMaster - February 5, 2004 10:52 PM (GMT)
You'll have to use a SSL to do what you want. Some language like PHP or ASP or whatever...
Bob - February 5, 2004 11:18 PM (GMT)
Consumed - February 6, 2004 05:44 AM (GMT)
PHP is good for things like that. It's got a lot of functions that make things like that really easy. Just download the manuel from
http://www.php.net .
FrozenKnight - February 6, 2004 05:53 PM (GMT)
Most polls are run useing Cookies and ip adresses. if your poll cookei doesnt exist and the ip address hasnt been used (at least with in the last coupple of minutes) then it's probaly a diffrent user. this method can be bypassed but any methos you use can be bypasses even SSl, PHP and ASP.
Incubator - February 6, 2004 09:24 PM (GMT)
for a simple poll you can use JS, but then I could vote a million times ;)
use php with a database to store the IP's
if the IP already exists he cannot vote.
and for those who say: dynamic ip: I know, but most commercial vote polls didnt fix that either, for I can vote multiple times there too
FrozenKnight - February 7, 2004 12:09 AM (GMT)
| QUOTE (Incubator) |
for a simple poll you can use JS, but then I could vote a million times use php with a database to store the IP's if the IP already exists he cannot vote.
and for those who say: dynamic ip: I know, but most commercial vote polls didnt fix that either, for I can vote multiple times there too |
That is why i suggested useing cookies too. and you can also check that to see if the cookie was set to make sure that they don't have cookies disabled. that way you at least slow them down if they are going to try to vote mupital times.
Bob - February 7, 2004 09:27 PM (GMT)
Well how do you do it with JS???
myork - February 8, 2004 01:04 AM (GMT)
I think I can summarise what people are saying, is that you need more than JS. JS only runs on the client. You need to add code to the server that stores the results and generates the resulting web pages.
The extra talk about cookies etc is just to stop bad people from messing with your poll by voting multiple times.
You need three things on the server.
1) A script that accept your vote.
2) A script that generates a webpages based on the submiited votes.
3) An HTML page with a FORM that displays the possable votes.
On the client you dont actually need JS to make a poll it can be done with simple HTML form.
Incubator - February 10, 2004 12:12 AM (GMT)
or you could run a server-side JS :P
just like you can run a server-side VBScript ;)