title: php header redirect does not work
body: <p>Here is the code:</p>
  
  <pre><code>    &lt;?php 
          $curDate = date("r",strtotime("now"));
  
          if($database-&gt;addNewSale($_SESSION['username'],$_SESSION['userid'], $_SESSION['cart'],$curDate) ==10){
  
              //Some of the offers in the cart have expired and cannot be purchased!
              header("Location: ../order/index.php");
  
              exit;
  
  
              } else if($database-&gt;addNewSale($_SESSION['username'],$_SESSION['userid'], $_SESSION['cart'],$curDate)){
                  echo "insert process ok";
  
              }
  
                  else echo "sale has not been saved into the db";
  
           ?&gt;
  </code></pre>
  
  <p>But, when the function <code>addNewSale</code> returns <code>10</code> which is the code for error in cart, the redirect header function does not actually redirect to the page I set.</p>