title: Checking Correct Answer and Submitting Form
body: <p>I am admittedly not as skilled in PHP as I would hope to be. Most of my experience is with Wordpress loops.</p>
  
  <p>I'm trying to create a very simple quiz that carries the number of correct answers in the URL (eg. domaindotcom/?p=3 if they've got 3 correct answers so far).</p>
  
  <p>I'm using the following PHP code to start it off:</p>
  
  <pre><code>&lt;?php 
      /* Gets current correct answer Count */ 
      $answer_count = $_GET["p"]; 
  
      /* checks to see if the submitted answer is the same as the correct answer */
      if ($_POST["submitted-answer"] == "correct-answer") {
          $answer_count++;
      }
  ?&gt;
  </code></pre>
  
  <p>Now I know I can get the correct link by using the link:</p>
  
  <pre><code>&lt;a href="link-to-next-question.php/?p=&lt;?php echo $answer_count; ?&gt;"&gt;Next Question&lt;/a&gt;
  </code></pre>
  
  <p>But now I'm trying to use it in a form and confused by POST, GET, etc.</p>
  
  <p>Here's my HTML:</p>
  
  <pre><code>&lt;form name="quiz" action="" method="POST"&gt;
  &lt;label for="o1"&gt;&lt;input type="radio" name="grp" id="o1" value="o1"&gt; Label 1&lt;/label&gt;
  &lt;label for="o2"&gt;&lt;input type="radio" name="grp" id="o2" value="o2"&gt; Label 2&lt;/label&gt;
  &lt;label for="o3"&gt;&lt;input type="radio" name="grp" id="o3" value="o3"&gt; Label 3&lt;/label&gt;
  &lt;input type="submit" value="Next Question" class="btn"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>How can I choose the correct answer (security not important, it's just a fun quiz) and then send them along to the next URL while adding the increment to the $answer_count before the URL is created?</p>