Web Hosting Talk







View Full Version : Polls(PHP, JS, FLASH)


InterVertex
06-22-2003, 01:56 PM
Can someone help me create a poll in PHP, JS, or even Flash?
I want to keep this at my own host, so I don't want to get those ones with advertisements...

I'm not too good at scripting things like this to work properly, so any help is good. :)

I want one like the simple polls at NHL's Official Website (http://www.nhl.com)

Thanks,

Rafeed

Please post here, PM, or msg me at rafeed19@hotmail.com

InterVertex
06-23-2003, 01:21 PM
No help? :(

Lagniappe-labgeek
06-23-2003, 01:36 PM
You don't need to create it - it's been done many times.

http://www.hotscripts.com/PHP/Scripts_and_Programs/Polls_and_Voting/index.html
There are 109 on there. The vast majority of which are free.

And there are many others in other languages such as perl, asp, java, etc.

Probably the reason nobody's replied before now, is that you haven't really asked any questions. You just said you wanted help building one. Most of us don't mind helping others out, but we're usually not just going to do it for you. There are a few that may, and many that you can hire usually pretty reasonably. Go check out the Job Offers/Request section for that.

If you want to download and attempt to install one of the ones I gave a link to, or some other one you find, and have problems let us know. Likewise, if you decide you want to write it yourself (a great idea IF you're willing to take the time to learn!), and get stumped, I think you'll find many of us will try to help out as much as possible. If you've never programmed at all, and want to learn php - check out the recent thread in this same section about that. There's some good info there.

Good Luck

InterVertex
06-23-2003, 04:13 PM
Well, I made my own but I am having a lot of trouble on how to make it work...


<table cellspacing=0 cellpadding=0 width="174" align="center">
<tr>
<td bgcolor="#CCCCCC">
<table cellpadding="5" cellspacing="0" border="0" width="174">
<tr> </tr>
<tr>
<td>
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">How
will Indianapolis finish its first season?</font></div>
</td>
</tr>
</table>
<form method="post" name="Form0" action="">
<div align="center">
<input type="hidden" name="service" value="direct"/>
<input type="hidden" name="context" value="EventIndex/pageWrapper.insertQuickPoll.pollChoiceForm"/>
<input type="hidden" name="sp" value="S0"/>
<table cellspacing="0" cellpadding="0" border="0" bgcolor="#cccccc" width="177">
<tr>
<td width=174 valign=middle align="left" class="headlinetext">
<font face="Verdana, Arial, Helvetica, sans-serif" size="1">
<input type="radio" name="pollChoiceGroup" value="0"/>
Last Place</font></td>
</tr>
<tr>
<td width=174 valign=middle align="left" class="headlinetext">
<font face="Verdana, Arial, Helvetica, sans-serif" size="1">
<input type="radio" name="pollChoiceGroup" value="1"/>
Division Champion</font></td>
</tr>
<tr>
<td width=174 valign=middle align="left" class="headlinetext">
<font face="Verdana, Arial, Helvetica, sans-serif" size="1">
<input type="radio" name="pollChoiceGroup" value="2"/>
Conference Champion</font></td>
</tr>
<tr>
<td width=174 valign=middle align="left" class="headlinetext">
<font face="Verdana, Arial, Helvetica, sans-serif" size="1">
<input type="radio" name="pollChoiceGroup" value="3"/>
League Champion</font></td>
</tr>
<tr> </tr>
</table>
<table bgcolor="#cccccc" cellspacing="0" cellpadding="5" border="0" height="15" width="143">
<tr>
<td valign="bottom" align=left>
<div align=center>
<input type="submit" name="pollSubmitButton" value="Vote!" class="headlinetext" align="right"/>
</div>
</td>
</tr>
</table>
<input type="hidden" name="Form0" value="2"/>
</div>
</form>
</td>
</tr>
</table>



This is going to go on my main page, but I don't know how to make it work so that I can see the results, and etc.

Here is the site Site here (http://www.rafeed.cyber-nhl.net/racers/index.jsp)

Lagniappe-labgeek
06-23-2003, 05:54 PM
Well you've got the form part there, but no action defined for the form yet. I'm not a JSP programmer though. I do Java, so I might be able to help some. But I've not done jsp's though. Maybe one of the others could help. I'd suggest changing the thread title to reflect you're using JSP.

Short rundown on what your processing page will need to do.
Check that the voter hasn't voted recently (ip address? cookie?)
IP address - not static for many could re-vote with change (next call to isp for dialup) Cookie - some people still get upset about these. Some software clear them automatically. User could clear them themselves and re-vote. But really you're bid thing it to prevent automated voting.
Then if not voted before, add it in somewhere (database, text file?)
Display the results.

You may also want to provide a link to a results page without having to vote. For people who vote early may want to come back and see the results later.