FockerFGAA Posted October 5, 2008 Share Posted October 5, 2008 My site is a sports site and we are in the process of trying to get a Top 25 poll made. From what I have seen the best way to do this is to make 25 drop down boxes with all the teams available in them. Then they would be submitted and the values would be submitted to a mysql database. I am extremely noobish when it comes to these sort of things (I have had issues just getting the drop down boxes made), but the issues I am feeling I will run into the most problem with are the values of each box and the checks to make sure duplicate teams are put in. So box 1 would be worth 25 points, box 2 24 points, all the way down to box 25 1 point. How do I assign a value to a box so that I can have it sent to my database which would then be queried to show the top 25 scores basically? Also, I know there is a way to make sure that people with the same IP don't keep voting, but is there a way to make sure that each box has a unique answer in it? So that way Box 1 and Box 23 say wouldn't have the same team in them since that would skew the points. If there is any suggestions for tutorials that would help me or anything like that I would be greatly appreciative of it. I have searched all of the internet and almost every poll I see is a buttons poll and even the drop down box ones don't follow the rankings system I am referring to. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/127134-top-25-poll-rankings-help/ Share on other sites More sharing options...
Orio Posted October 5, 2008 Share Posted October 5, 2008 What you're asking to do is not difficult and can be done easily if you have enough knowledge and experience. But the problem here is that you are yet to have that knowledge (according to your post). You obviously don't expect someone to hand you the script with no cost. So basically you have two options- either go to the freelancing forum and ask for someone to do this for you, or do it the hard way- learn it yourself. In case you chose the second option, here's my recommendation: Read a basic PHP/MySQL tutorial that will teach how to create and connect to databases and then select/insert/update tables. Read a tutorial about form handling with PHP, so you could understand how to receive and manage the input you get from your dropdowns. In your case using an array of drop downs would be easier, but that's something you'd have to learn too. This way validating that there are no duplicates would be easier too, using php's array handling functions. Thats basically what you'll have to learn, and then use that knowledge to create your own system. I am not trying to be harsh or mean or anything, you seem to be a nice and serious guy, but jumping right into something like that when creating a html form is a struggle may be over your head. I am not saying you can't do it, all I'm saying is that it'll take you some time to learn and use the knowledge to create a system like that. My honest advice is- if you have some money available, go find a freelancer. Orio. Link to comment https://forums.phpfreaks.com/topic/127134-top-25-poll-rankings-help/#findComment-657660 Share on other sites More sharing options...
Barand Posted October 5, 2008 Share Posted October 5, 2008 Generate dropdown1 with all team names. When the user selects a team, use AJAX to generate the next dropdown with all the teams except that chosen one. When the second is chosen, generate dropdown3 with teams minus first two, and so on. Duplicates are then impossible. Link to comment https://forums.phpfreaks.com/topic/127134-top-25-poll-rankings-help/#findComment-657703 Share on other sites More sharing options...
Orio Posted October 6, 2008 Share Posted October 6, 2008 Ummm not quite. I agree that doing that will decrease the number of duplicates dramatically, but you always need to take javascript injection in consideration. Orio. Link to comment https://forums.phpfreaks.com/topic/127134-top-25-poll-rankings-help/#findComment-657972 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.