0

I'm working right now at present to make a quiz page to my friends about firefighter training. and I'm thinking about whether I can do it with javascript or should I do it with php?. where there are about 140 questions but I will start to build so there are only 10 questions to start with :)

I never try to do anything like that before so hope you can help me to the right and explain to me how to do it and help me further.

I think such a little like this:

<?php
if(isset($_POST["ok"] == 1)
{
    echo "TRUE!";
}
elseif(isset($_POST["ok"] >= 1)
{
    echo "FALSE!";
}
?>
<form action="#" method="post">
<input type="checkbox" name="1" /><p>Bla bla bla</p>
<input type="checkbox" name="2" /><p>Bla bla bla</p>
<input type="checkbox" name="3" /><p>Bla bla bla</p>
<input type="submit" name="ok" value="Ok" />
</form>

It's probably not such but it must be such clicks on Mon such as it is true then it must be in it or look like in the still hope you can follow me in what I would like to have built?

  • Something similar was asked recently in [this question](http://stackoverflow.com/questions/14462380/how-can-i-see-if-the-users-choice-in-the-quiz-is-correct/14467642#14467642). Maybe the code shown in my answer there will give you some ideas... – Floris Feb 13 '13 at 01:20
  • Thanks., i will look and its, and i will make its to mysqli :) ha a nice day :) – Jesper petersen Feb 13 '13 at 01:22

1 Answers1

1

Be a little clearer with your question. What exactly are you trying to accomplish?

If you write the quiz in PHP, then you will have to have the answers revealed after a form submission. This can be accomplished either with redirection, or AJAX through JavaScript.

If you write the answer checking in JavaScript, then all of the logic will be done client side, rather than server-side. This is the method I would recommend, as it will accomplish the same thing, and would really be much more simple for this task, as it doesn't seem you are really looking for security in this quiz.

Pretty much, go with PHP if you are looking for some something secure, JavaScript if you are doing it for fun.

jtst
  • 312
  • 4
  • 16