title: header function is not working on online server
body: <p>I have been having problem with header(); This script was generated by dreamweaver login. why will it work on some hosting company and do not work on the company i m hosting?</p>
  
  <p>I have notice that header() do not work on my hosting company at all on all my pages. why do i have this problem? </p>
  
  <pre><code>if (PHP_VERSION &gt;= 5.2) {
      session_regenerate_id(true);
  } else {
      session_regenerate_id();
  } 
  
   //declare two session variables and assign them 
  $_SESSION['MM_Username'] = $loginUsername; 
  $_SESSION['MM_UserGroup'] = $loginStrGroup;  
  
  if (isset($_SESSION['PrevUrl']) &amp;&amp; false) { 
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];     
  } 
  header("Location: " . $MM_redirectLoginSuccess ); } 
  else { 
      header("Location: ". $MM_redirectLoginFailed ); 
  } 
  }
  </code></pre>