title: How to stop a redirect?
body: <p>I have 2 forms. one sumbit is just an submit/add and the second is select/redirect. right now both are redirecting. How can I prevent the top submit from redirecting following? </p>
  
  <pre><code>&lt;?php
  if($_POST){
  
          //store as session variable
          $_SESSION['id'] = $_POST['bolredir'];
          //forward browser
          die(header("Location: add-job.php"));
  }
  ?&gt;
  
  
  &lt;!DOCTYPE html&gt;
  
          &lt;body&gt;
         &lt;div class=""&gt;
                  &lt;form name="addcust" method="post" action="index.php"&gt;
                          &lt;label&gt; Name:&lt;/label&gt;
                          &lt;input type="text" id="cust_name" name="cust_name"/&gt; &lt;br /&gt;
                          &lt;input type ="submit" name="addcust" value="Submit" /&gt; &lt;br /&gt; &lt;br /&gt;
                  &lt;/form&gt;
          &lt;/div&gt;
  
     &lt;?php
  
   try
       {
       $conn = new PDO("mysql:host=localhost;dbname=$dbname", $username, $password);
       $stmt = $conn-&gt;prepare("SELECT * FROM customer");
       $stmt-&gt;execute();
  
       $result = $stmt-&gt;fetchAll();
   ?&gt;
   &lt;form action="&lt;?= $_SERVER['PHP_SELF']; ?&gt;" method="POST"&gt;
   &lt;select name="bolredir"&gt;
   &lt;option&gt;&lt;/option&gt;
   &lt;?php
       foreach ($result as $row)
           {
           echo "&lt;option value=\"{$row['id']}\"&gt;{$row['cust_name']}&lt;/option&gt;";
          //$_SESSION['id'] = $row['cust_name'];
           }
       }
   ?&gt;
   &lt;/select&gt;
    &lt;input type="submit" name="Submit" value="Submit" /&gt;
   &lt;/form&gt;
  
   &lt;/body&gt;
  
   &lt;/html&gt;
  </code></pre>