Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

voting script

Original Message
Name: BigShow
Date: October 8, 2006 at 19:57:17 Pacific
Subject: voting script
OS: xp
CPU/Ram: pentium 4
Model/Manufacturer: dell
Comment:
I have a question about creating a script that would allow someone to go to my website and vote on something. For example, if I had a survey on there for the best hitter of all time and gave 5 choices, i would want people to vote and I would want the results to show up in some sort of graph automatically and immediately, if possible. Would I have to make a small database? Any help would be appreciated.

Report Offensive Message For Removal


Response Number 1
Name: Michael J (by mjdamato)
Date: October 8, 2006 at 22:20:12 Pacific
Subject: voting script
Reply: (edit)
"Would I have to make a small database?"

Not necessarily. You could save the results in a text file. Just read the text file to display the results. When someone posts their vote, open the text file and change the appropriate results and save it back to the file.

However, doing this does have it's problems. If, for instance, two people submit their votes at very close to the same time you could end up corrupting the file.

Michael J


Report Offensive Follow Up For Removal

Response Number 2
Name: BigShow
Date: October 9, 2006 at 16:28:54 Pacific
Subject: voting script
Reply: (edit)
Michael let me revise the question as I figured exactly what i want, I want to give choices to vote on, i want someone to vote on then (example vote the best of 5 ) and have this compute automatically and every hour or so have it update the order of the choices, or maybe even update the order automatically. I dont want to go through emails tirelessly, i figure php and a database, if u agree have you seen any pre made scripts like this or close to it.

Report Offensive Follow Up For Removal

Response Number 3
Name: Michael J (by mjdamato)
Date: October 9, 2006 at 18:22:35 Pacific
Subject: voting script
Reply: (edit)
Again, the answer is yes. You can use a database or you could use a flat file. You can get as complex or as simple as you wish.

For example, if you had a vote for the best actors ever and you had 5 options, the txt file might contain the following (minus the lines):
-------------------
Mel Gibson: 25
Leroy Jenkins: 2
William Shatner: 0
Tom Hanks: 45
Donald Sutherland: 8
-------------------

When soeone makes a vote you have the PHP open the file and increment the value of the entry they selected by 1.

When displaying the results (or to order the vorting options) just have the PHP open the file and read the contents. Then display the results accordingly.

Michael J


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: voting script

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




DSHUB24 Connection Problems

need help with dsl and dial up

novel 3.12

help mandriva install last straw!

Icon Scaling in Explorer Bar


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC