title: PHP- Redirect to another page
body: <p>My question is very simple. but I am struggling with it too much. The problem is once I hit the submit button that page should redirect to some other page. Kindly just tell me what I have done wrong? Because I have tried everything.</p>
  
  <p>Code:</p>
  
  <p>Update-docket.php</p>
  
  <pre><code>&lt;?php
  //error_reporting(0);
  $link = mysqli_connect("localhost", "home_db", "root", "");
  
  // Check connection 
  if($link === false){
      die("ERROR: Could not connect. " . mysqli_connect_error());
  }
  
  // Escape user inputs for security
  $sql = 'SELECT * FROM prod_details';
  $result = mysqli_query($link,$sql);
  
  while ($row = mysqli_fetch_array($result))
  { 
       $Quantity1 = $_POST['p_'.$row['id']. ''];          
       $id = $row['id'];
       $store = $row['rstore'];
       // echo $store;
  
       foreach ($_POST as $key =&gt; $value) 
       {}
  
       if(!empty($Quantity1)) {
           $query="update prod_details SET rdocket='$Quantity1' WHERE id='$id'";
           if(mysqli_query($link, $query)) {
              header('Location: /docket-details.php');
              exit();
           } else {
              echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
           }
        }
    }
  </code></pre>
  
  <p>docket-details.php</p>
  
  <pre><code>&lt;form class="form-horizontal" action="update-docket.php" method="post" name="myform" autocomplete="off"&gt;
    &lt;button  type='submit'  name='submit' class='btn c-theme-btn c-btn-square c-btn-uppercase c-btn-bold'&gt;Submit&lt;/button&gt;
  </code></pre>
  
  <p>Please help!!!</p>