title: Validate correct answer and add marks in PHP quiz
body: <p>I am working on a simple quiz web app and i want to validate each and every question on submit button showing the correct and add marks for right questions.</p>
  
  <p>I have created my first question page like this</p>
  
  <pre><code>&lt;?php
  defined('BASEPATH') OR exit('No direct script access allowed');
  ?&gt;&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Cric Quiz &lt;/title&gt;
  
      &lt;link href="&lt;?php echo base_url(); ?&gt;assets/style.CSS" rel="stylesheet" type="text/css"/&gt;
  
      &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div&gt;
      &lt;h1&gt;Cric Quiz&lt;/h1&gt;
  &lt;/div&gt;
  
  &lt;div id='quesNo'&gt;
      &lt;center&gt;Question 01&lt;/center&gt;
  &lt;/div&gt;
  
  &lt;div id='questions'&gt;
      &lt;center&gt;When did Australia win their first ever world cup?&lt;/center&gt;
  &lt;/div&gt;
  
  &lt;div id='answers'&gt;
  &lt;input type="radio" name="year" value="1992"&gt;1992&lt;br&gt;
  &lt;input type="radio" name="year" value="1996"&gt;1996&lt;br&gt;
  &lt;input type="radio" name="year" value="2000"&gt;2000&lt;br&gt;
  &lt;input type="radio" name="year" value="2012"&gt;2012
  &lt;/div&gt;
  
  &lt;center&gt;&lt;a href="&lt;?=base_url().'index.php/Questions/question_2';?&gt;" class="button1"&gt;Next&lt;/a&gt;&lt;/center&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My controller</p>
  
  <pre><code>&lt;?php
  defined('BASEPATH') OR exit('No direct script access allowed');
  
  class Questions extends CI_Controller {
  
  public function question_1()
      {
  
          $this-&gt;load-&gt;view('quiz_one');
  
      }
  
      public function question_2()
      {
  
          $this-&gt;load-&gt;view('quiz_two');
  
      }
  }
  </code></pre>
  
  <p>How to validate my answers in my controller</p>
  
  <p>PS: I'm using codeigniter</p>