title: How to move from current PHP page to another PHP page if condition true?
body: <p>I am working on a web project where <strong>I want to move from one PHP page to another Php page if condition true</strong>...</p>
  
  <p>In below login PHP page, I am getting  <em>username and password</em> using $_POST[]. if both username and password got matched in (<strong>if statement</strong>) of current PHP login page then, I want to jump to another PHP page(choice.php) specified in <strong>header function</strong> below after if.</p>
  
  <pre><code> &lt;html&gt;
   &lt;body&gt;
   &lt;head&gt;
   &lt;/head&gt;
   &lt;form method="post" action="login.php"&gt;
  
  &lt;div id="div1"&gt;
    &lt;h1&gt;welcome to bizdiary&lt;/h1&gt;
    &lt;div id="div2"&gt;
  
    &lt;label &gt;Username&lt;/label&gt;
    &lt;input id="name"  type="text" name="username" value="" 
         placeholder="username" /&gt;
    &lt;label &gt;Password&lt;/label&gt;&lt;input type="text" name="password" value="" 
      placeholder="password"/&gt;
  
    &lt;input type='submit' name="login" value="login" &gt;
  
       &lt;/form&gt;
  
   &lt;?php
        if(isset($_POST['submit'])){
  
  
        $username=$_POST['username'];
        $password=$_POST['password'];
  
       if($username=='root' &amp;&amp; $password=='tiger'){
      header( "Location:http://localhost/bizdiary/choice.php" ); die;
        }
       }
     ?&gt;
  </code></pre>
  
  <p>
  </p>