TheFilmGod Posted February 14, 2007 Share Posted February 14, 2007 I was hoping to create an "evaluate us" quiz on my site where visitors get to vote on how good they thing portions of the site is. I was hoping to have 20 questions and five answers: Horrible, Bad, Okay, Good, Awesome. Each answer would be assigned a number between 1 - 5. Now the tricky part is after the test is taken, the results are sent to a mysql and stored there and so visitors can see the average vote for each question. A lot like a poll, but with many many questions. Lastly, I'd like ip tracking so people can't spam. How can this be done. Any ideas on any portion of this task? Anything would be extremely appreciated!!! Link to comment https://forums.phpfreaks.com/topic/38419-evaluate-us-php/ Share on other sites More sharing options...
benjaminbeazy Posted February 14, 2007 Share Posted February 14, 2007 make an answer table with 20 columns, 1 for each question and the value being 1 -5 based on input, also add an ip column and store ip for each do a queryto check for the ip before letting user take quiz then you can do some math with query results to get averages for each question Link to comment https://forums.phpfreaks.com/topic/38419-evaluate-us-php/#findComment-184290 Share on other sites More sharing options...
TheFilmGod Posted February 14, 2007 Author Share Posted February 14, 2007 sounds good. But how do you check the query for the ip address? Link to comment https://forums.phpfreaks.com/topic/38419-evaluate-us-php/#findComment-184300 Share on other sites More sharing options...
benjaminbeazy Posted February 14, 2007 Share Posted February 14, 2007 $query = "SELECT ip from `answers` WHERE `ip`='$ip'"); $result = mysql_query($query); $num = mysql_num_rows($result); if($num > 1){ $error = "You've already taken the quiz."; } if($error){ echo $error; }else{ include "quiz.php"; } just remember that multiple users can connect from one ip i.e. LANs Link to comment https://forums.phpfreaks.com/topic/38419-evaluate-us-php/#findComment-184306 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.