title: how i use of header tag to redirect page in php
body: <p>I want to redirect the page on the if condition.</p>
  
  <p>this is my html page </p>
  
  <pre><code>&lt;form name="frmpayment" enctype="application/x-www-form-urlencoded" action="payment_mode.php" method="POST"&gt;
      &lt;table&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;label for="mode"&gt;Select Mode&lt;/label&gt;&lt;/td&gt;
      &lt;td&gt;
     &lt;select name="selectmode" id="slctmode" size="1"&gt;
     &lt;option selected&gt;Selected Mode&lt;/option&gt;
     &lt;option value="1"&gt;Online Payment&lt;/option&gt;
     &lt;option value="2"&gt;Cash on Delevery&lt;/option&gt;
      &lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;
      &lt;input type="submit" name="btnmode" value="Done"/&gt; 
           &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  
      &lt;/form&gt;
  </code></pre>
  
  <p>and this is my payment_mode.php page </p>
  
  <pre><code>&lt;?php
  $i= $_POST['selectmode'];
  
  if($i&gt;1)
      {
          header("Location : detail.php");
  
      }
  else
      {
          header("Location : home.php");
  
      }
  
  ?&gt;
  </code></pre>
  
  <p>bt it does not redirect the page detail.php and home.php</p>