Jump to content

Evaluate Us PHP


TheFilmGod

Recommended Posts

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

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

 

 

$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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.