aaricwon Posted March 8, 2008 Share Posted March 8, 2008 I am making a page on this site that shows the fight card for a martial arts event. basically a list of who is fighting who you can see the start of it http://www.bjjnews.org/tuffnuf/index.php?option=com_content&task=view&id=52 I would like to have it so you can vote who you think will win. basically click on the name of the fighter you think will win. I would like to have that for each match listed... I can't figure out how Quote Link to comment https://forums.phpfreaks.com/topic/95126-multiple-polls-on-one-page-can-i-do-this/ Share on other sites More sharing options...
laffin Posted March 8, 2008 Share Posted March 8, 2008 Either multiple forms, or by using radio boxes / checkboxes Quote Link to comment https://forums.phpfreaks.com/topic/95126-multiple-polls-on-one-page-can-i-do-this/#findComment-487289 Share on other sites More sharing options...
aaricwon Posted March 8, 2008 Author Share Posted March 8, 2008 I guess what I really can't figure out is how to have a poll laid out like the link I provided, where each match is a poll but the fighters name is the link to vote. Quote Link to comment https://forums.phpfreaks.com/topic/95126-multiple-polls-on-one-page-can-i-do-this/#findComment-487292 Share on other sites More sharing options...
laffin Posted March 8, 2008 Share Posted March 8, 2008 than ya wudn need a form at all, just a link. with pollid and poll voted for question is, how do you plan on keeping ppl from voting more than once? Quote Link to comment https://forums.phpfreaks.com/topic/95126-multiple-polls-on-one-page-can-i-do-this/#findComment-487296 Share on other sites More sharing options...
aaricwon Posted March 9, 2008 Author Share Posted March 9, 2008 at this point i don't care if they vote more than once. can you help me find a poll? Quote Link to comment https://forums.phpfreaks.com/topic/95126-multiple-polls-on-one-page-can-i-do-this/#findComment-487449 Share on other sites More sharing options...
laffin Posted March 9, 2008 Share Posted March 9, 2008 <php $id=isset($_GET['id'])?intval($_GET['pollid']):0; $vote=isset($_GET['vote'])?intval($_GET['vote']):0; $returnto=isset($_GET['returnto'])?$_GET['returnto']):'/'; @mysql_query("UPDATE polls SET hits=hits+1 WHERE pollid=$id AND vote=$vote"); $returnto=url_parse($returnto,PHP_URL_PATH); $returnto=(file_exists($returnto)?$returnto:'/'); header("Location: $returnto"); ?> very simple script, the question is how yer polls section is setup, so mysql_query shud be altered for this. so can be called from any page with votefor.php?id=xxx&vote=yyy&returnto=zzz where xxx = Poll ID yyy = Vote zzz = current page/script to return to after updating the polls Quote Link to comment https://forums.phpfreaks.com/topic/95126-multiple-polls-on-one-page-can-i-do-this/#findComment-487462 Share on other sites More sharing options...
Xajel Posted March 9, 2008 Share Posted March 9, 2008 it maybe just a smiple code eg vote.php?match={MATCH_ID}&winner={WINNER_NAME_OR_ID} and in the vote.php you want to add some cookies to stop flooding as this type will give another vote by just refreshing the page !! this will be like what laffin said above, with thanks to him personnally, I would like to prefere AJAX, safer and more interactive, they may click on the fighter, then a new space will shows with loading ( or animated gif ) and then loads the result directly in the same place.. to give you an example, just see the poll in this site, there's no need to refresh the page or load another page, in the same page the vote & results too, if the user clicked, then the links will be replaced by poll results so he wont be able to vote again unless he refreshed the page, but you can use cookies here to see if this guy voted before or not http://blog.se-nse.net/ - poll is in the left side second from top... Quote Link to comment https://forums.phpfreaks.com/topic/95126-multiple-polls-on-one-page-can-i-do-this/#findComment-487466 Share on other sites More sharing options...
laffin Posted March 9, 2008 Share Posted March 9, 2008 Agreed Ajax is great for these type of situations. No redirction to another script, and can get results. Quote Link to comment https://forums.phpfreaks.com/topic/95126-multiple-polls-on-one-page-can-i-do-this/#findComment-487472 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.