title: How to pass query parameters from form's action attribute in php?
body: <p>I want to pass a query parameter from one page to another in PHP.<br>
  I am redirecting using form's action attribute, instead of hyperlink tag.</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Question 1&lt;/title&gt;.       
    &lt;/head&gt;
     &lt;body&gt;
        &lt;form method="GET" action="Result.php?question=1"&gt;
   &lt;b&gt;Question 1. What is the full form of PHP?&lt;b&gt; &lt;br&gt;
          A)&lt;input type="radio" name="q1" value="a"&gt; 
             Pre HyperText Processor&lt;br&gt;
          B)&lt;input type="radio" name="q1" value="b"&gt; 
             Post HylerText Processor&lt;br&gt;
         C)&lt;input type="radio" name="q1" value="c"&gt; 
             Personal HyperText Pages&lt;br&gt;
          D)&lt;input type="radio" name="q1" value="d"&gt; 
             HyperText Preprocessor&lt;br&gt;
          &lt;input type="submit" name="g" value="Go"&gt;
     &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>I am getting below error:</p>
  
  <pre><code>Undefined index:question in Result.php on line 2
  </code></pre>
  
  <p>Result.php</p>
  
  <pre><code>&lt;?php
  $score=0;
  $q=$_GET["question"];
  if($q)
  {
     if($_GET['g']!=null)
     {
     switch($q)
      {
         case 1: $answer1='c';
                 if($_GET["q1"]==answer1)
                   ++$score;
                 break;
         default: print " try again";
       }
     }
  }
  </code></pre>
  
  <p>Why am I not getting the values passed in query parameters?</p>