View Full Version : Collecting votes on a webpage
Wedgy
11-04-2005, 02:11 AM
I have seen various forms on forums where you set up a voting thing,
and others browsing a thread can vote on some silly thing.
What is the right tool to do something like this on a simple webpage?
I was thinking something like two pictures (left and right), like Lennon versus Bush or something, and the viewer just clicks a button to vote for the picture/item/person of their choice, but only once per visit or IP address.
Very simple idea, but should it be a form, or javascript, or what?
It's a simple form, but it's backed by a server-side script and often a database.
Wedgy
11-04-2005, 05:09 AM
hmmm, sounds like it either can't be or hasn't been done without resorting to server-side antics.
I was hoping there was some way to store info in a simple textfile and display the current vote/score for the voter, without having to involve the server.
Afraid not. You're going to have to store results on the server at least, aren't you.
Wedgy
11-04-2005, 07:56 PM
Yes. I guess what I meant was, storing the results independantly on the server, without getting involved in PHP, server-side programming, or databases.
To store something on the server you'll need at least some form of server-side scripting.
Wedgy
11-05-2005, 12:38 AM
It seems strange that if you can upload textfiles remotely without bothering the server, why can't you save a single keystroke, even if you have to use a Java Applet or something? Maybe that actually is 'server-side' but I guess the question is, is there a very simple tiny file and a few lines of code that would do such a simple task, even if you have to compile an applet or a bit of Python first?
It seems strange that if you can upload textfiles remotely without bothering the serverYou can't. As you guessed, there must be a server-side component as well, which the applet would connect to - and so long as you're doing that, you might as well just use a form.
is there a very simple tiny file and a few lines of code that would do such a simple task, even if you have to compile an applet or a bit of Python first?Python is interpreted :p There most certainly are several very simple ways of doing this, but they all need server-side interaction. You could use an applet to connect to an FTP server running on the site, eliminating the need for a server-side script, but this would be very insecure, as it would need read-write access and would contain the username and password for the site, rendering your data open to arbitrary editing by anyone with the skill to find them.
Wedgy
11-05-2005, 08:18 PM
Wow, that is important information. So what I was thinking was not possible without a serious breach of security?
The voting data itself is not important, perhaps even frivolous, but I didn't realize you had to put a password (embedded and encoded?) inside your applet! Ouch!
JDigital
11-08-2005, 02:29 AM
So how could this be done with a database? Is it pretty simple...or no?
I didn't realize you had to put a password (embedded and encoded?) inside your applet!Usually, you don't. The problem is that "usually," you'd have some form of server-side script that the applet would connect to, rather than using FTP, which is more or less your only other option.
So how could this be done with a database? Is it pretty simple...or no?The moral of this story is: it's simple if you have a server-side language, otherwise it's a nightmare :p
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.