Go Back   Dynamic Drive Forums > General Coding > MySQL and other databases
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 05-28-2006, 09:55 AM
pistolpapa pistolpapa is offline
Junior Coders
 
Join Date: May 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default poll page

I'm fairly new to php and mySQL. Being a dog lover, I'm thinking about making a personal website where there's a poll page about America's favorate dogs. This is the idea in my head.

1. drop down menu for people to select their region, say hawaii or new york.
2. several text boxes to get people's input as vote on dog kinds
3. email address
4. submit button

After submittion, the names get validated (meaning repeated entries will only count once), email address got recorded into database, and votes get stored into database.

Don't wanna bore the follks here, I like to have the top five kinds of dogs of america listed as a feedback from the database, so it won't need to be updated often even when the ranking changes. In addition, statistics about top entries could be analyzed in a pie chart.

AAAaaright, i'm finally over. Now my question is that, am I pretty much looking at serious php and mySQL programming from scratch? I've tried to look into scripts such as phppoll, phpQuestionnaire... which offers execellent poll service, but doesn't do everything I needed, so now I'm at this confusion point of what to do. Any light is going to be appreciated.

God bless.
Reply With Quote
  #2  
Old 05-28-2006, 12:31 PM
simonf's Avatar
simonf simonf is offline
Senior Coders
 
Join Date: Sep 2004
Location: Johannesburg, South Africa
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What you could do is download a cookie to their PC and if they try to go to the data form page make a pop up to say already voted etc. This would not stop them deleting the cookie if you give it a simple name, but it would confuse most people and make the complete process faster, as it would not have to search the complete DB looking for duplicates. Just a suggestion.
__________________
Very Best Rgds, Simonf :cool:
__________________________________
My Site | E-Mail Me | RSA Search Engine
Reply With Quote
  #3  
Old 05-28-2006, 12:38 PM
simonf's Avatar
simonf simonf is offline
Senior Coders
 
Join Date: Sep 2004
Location: Johannesburg, South Africa
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

A free poll script at this url
__________________
Very Best Rgds, Simonf :cool:
__________________________________
My Site | E-Mail Me | RSA Search Engine
Reply With Quote
  #4  
Old 05-28-2006, 09:06 PM
pistolpapa pistolpapa is offline
Junior Coders
 
Join Date: May 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Simon,

to complete my project though, I need more than just the script provided. Am I looking at serious PHP/mySQL coding from scratch, or I can use partially the code and modify myself.
Reply With Quote
  #5  
Old 05-28-2006, 09:10 PM
pistolpapa pistolpapa is offline
Junior Coders
 
Join Date: May 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by simonf
What you could do is download a cookie to their PC and if they try to go to the data form page make a pop up to say already voted etc. This would not stop them deleting the cookie if you give it a simple name, but it would confuse most people and make the complete process faster, as it would not have to search the complete DB looking for duplicates. Just a suggestion.
Sounds good.

Actually, I'd like them to vote only once on one day, but if they think of some more names some other day, they are welcome to come back and vote tomorrow. So if there anyway to check their email address, and if it's the same one from an earlier input today, then they are prompted not to vote again, or the redirected to a page which says no you can no longer vote.
Reply With Quote
  #6  
Old 05-28-2006, 09:11 PM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
Thanks: 1
Thanked 180 Times in 172 Posts
Blog Entries: 2
Default

IP and cookie both, I'd think. Neither are certain measures, but neither should have any adverse effects either.
__________________
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Reply With Quote
  #7  
Old 05-29-2006, 07:24 AM
djr33's Avatar
djr33 djr33 is offline
Global Moderator
 
Join Date: Mar 2006
Location: N. California, USA
Posts: 6,408
Thanks: 11
Thanked 82 Times in 82 Posts
Default

IPs for dialup users rotate, so if you have 20 people from AOL visiting your site, you might end up with one who can't vote because their IP at the time matches what someone else had at the time they voted.


Logins are the only sure way. Aside from that, IPs are good, but if people wish to cheat, they can go to another computer.

Remember, you could just put "please don't vote twice"; the people who would honor that will honor using only their computer.
But the people who wouldn't honor that might use another machine... cheaters will always be cheaters.

So... if you have a way that it can be gotten around, it's not that much better than just "please don't vote twice".

Just something to think about.


Checking the email will only stop stupid users who don't know to put a new email. UNLESS you make them varify by an email sent to them... which is too much work for you and too much for them.
Also, people (myself included) have multiple email addresses sometimes for this purpose, or signing up for things that will inevitably give them spam at the email they use... so.. use a backup.
Cheaters, again, can cheat.
__________________
Daniel - <?php?> | <html>| Ich lerne Deutsch. | Studio l'italiano. | Estudiaba español. | Estudo português. | 日本語の勉強。| मैं हिन्दी सीखो | درس العربية
Reply With Quote
  #8  
Old 05-29-2006, 09:38 AM
simonf's Avatar
simonf simonf is offline
Senior Coders
 
Join Date: Sep 2004
Location: Johannesburg, South Africa
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Actually, I'd like them to vote only once on one day, but if they think of some more names some other day, they are welcome to come back and vote tomorrow. So if there anyway to check their email address, and if it's the same one from an earlier input today, then they are prompted not to vote again, or the redirected to a page which says no you can no longer vote.
You can date the cookie.. I.E only valid for the day in question!!!
__________________
Very Best Rgds, Simonf :cool:
__________________________________
My Site | E-Mail Me | RSA Search Engine
Reply With Quote
  #9  
Old 05-29-2006, 09:49 AM
simonf's Avatar
simonf simonf is offline
Senior Coders
 
Join Date: Sep 2004
Location: Johannesburg, South Africa
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Something like this:
Quote:
/**
* Sets a Cookie with the given name and value.
*
* name Name of the cookie
* value Value of the cookie
* [expires] Expiration date of the cookie (default: end of current session)
* [path] Path where the cookie is valid (default: path of calling document)
* [domain] Domain where the cookie is valid
* (default: domain of calling document)
* [secure] Boolean value indicating if the cookie transmission requires a
* secure transmission
*/
function setCookie(name, value, expires, path, domain, secure)
{
document.cookie= name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
__________________
Very Best Rgds, Simonf :cool:
__________________________________
My Site | E-Mail Me | RSA Search Engine
Reply With Quote
  #10  
Old 05-29-2006, 10:06 AM
simonf's Avatar
simonf simonf is offline
Senior Coders
 
Join Date: Sep 2004
Location: Johannesburg, South Africa
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Another example of a cookie that counts Cookie Example
__________________
Very Best Rgds, Simonf :cool:
__________________________________
My Site | E-Mail Me | RSA Search Engine
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:21 PM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.