title: Sending quiz answers using a php form
body: <p>I have forms which work fine. I have a quiz which works fine.</p>
  
  <p>When I incorporate the two they don't work fine :(</p>
  
  <p>The quiz works as a quiz but it wont send it out using php to my email address.</p>
  
  <p>Here is a bit of my code:</p>
  
  <pre><code>    &lt;head&gt;
        &lt;script&gt;
          CorrectAnswers = new Array();
          CorrectAnswers[0]=1;
          CorrectAnswers[1]=1;
          CorrectAnswers[2]=1;
          CorrectAnswers[3]=2;
  
          macrightchar='YES';
          macwrongchar='NO';
          winrightchar='YES';
          winwrongchar='NO';
  
          var platform = 'win'
          if (navigator.appVersion.indexOf('Mac') != -1) {platform = 'mac'}
          if (platform == 'mac') {
              rightchar = unescape(macrightchar)
              wrongchar = unescape(macwrongchar)
          }
          else {
              rightchar = unescape(winrightchar)
              wrongchar = unescape(winwrongchar)
          }
  
          function CheckAnswer(){
              var i = 0;
              var TotalCorrect = 0;
              var x = 0;
              var Score = 0;
  
              for (i=0; i&lt;CorrectAnswers.length; i++){
                  if (document.QuizForm.elements[i*2].selectedIndex == CorrectAnswers[i]){
                      document.QuizForm.elements[(i*2)+1].value = rightchar;
                      TotalCorrect++;
                  }
                  else{
                      document.QuizForm.elements[(i*2)+1].value = wrongchar;
                  }
              }
                  Score = Math.floor((TotalCorrect*100)/CorrectAnswers.length);
                  document.CheckForm.ScoreBox.value = Score + '%';
          }
      &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;form name="QuizForm" accept-charset="utf-8" method="post" action="forms/quiz/_process.php" onSubmit="return validate.check(this)"&gt;
          &lt;table class="widthOneHundredPercent"&gt;
  
          &lt;tr&gt;
          &lt;td class="tableCellFloat columnOne" valign="top"&gt;
          &lt;label for="Big_Media_offers_a_great_multiplatform_tool"&gt;Big Media offers a great multiplatform tool&lt;/label&gt;
          &lt;/td&gt;
          &lt;td class="tableCellFloat columnTwo" valign="top"&gt;
          &lt;select name="0"&gt;
          &lt;option&gt;???&lt;/option&gt;
          &lt;option&gt;True&lt;/option&gt;
          &lt;option&gt;False&lt;/option&gt;
          &lt;/select&gt;
          &lt;td valign=top&gt;
          &lt;input type="text" name="1" size=2 maxlength=2&gt;
          &lt;/td&gt;
          &lt;/td&gt;
          &lt;/tr&gt;
  
      &lt;tr&gt;
      &lt;FORM name="CheckForm"&gt;
          &lt;td align="center"&gt;
          &lt;font face="Geneva,Arial"&gt;&lt;input type="button" VALUE="Check" onClick="CheckAnswer()"&gt; Your score is  &lt;input type=text name="ScoreBox" size="4" maxlength="4"&gt;&lt;/font&gt;
          &lt;center&gt;&lt;input type="submit" value="Submit Form" /&gt;&lt;/center&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>When submit is pressed it will change the end of my file name in the address bar from quiz.php to quiz.php?ScoreBox=75%25. So it takes my correct answers and wrong answers. </p>
  
  <p>I need the quiz to show a live right and wrong answers when check scores is clicked but I also need to send the results using PHP.</p>
  
  <p>If I'm going at it completely wrong perhaps someone can point me in the right direction to start fresh.</p>
  
  <p>Regards.</p>