title: After collecting data in PHP I just want to redirect to another page but nothing is happening
body: <p>I created some PHP code where I collect data from another server. I confirmed the data is ok with a bunch of print statements like:</p>
  
  <pre><code>print "&lt;br /&gt;&lt;br /&gt;headline: " . $user-&gt;headline ;
  print "&lt;br /&gt;&lt;br /&gt;industry: " . $user-&gt;industry ;
  </code></pre>
  
  <p>That all works fine. But instead of using print to show the contents, I want to redirect to another URL on a different server and send that info over. So I commented out the print lines and instead created a set of query parameters and used the header function to try to redirect, as follows:</p>
  
  <pre><code>$params = '?success=ok&amp;uname=' . $_SESSION['uname']  . '&amp;odistate=' . $_SESSION['odistate'];
  $params .= '&amp;firstName=' . $user-&gt;firstName . '&amp;lastName=' . $user-&gt;lastName . '&amp;headline=' .   $user-&gt;headline . '&amp;industry=' . $user-&gt;industry;
  $params .= '&amp;summary=' . $user-&gt;summary . '&amp;publicProfleUrl=' . $user-&gt;publicProfileUrl . '&amp;emailAddress=' . $user-&gt;emailAddress;
  $params .= '&amp;numRecommenders=' . $user-&gt;numRecommenders;
  
  $url = 'http://www.example.org/profileInfo/' . $params;
  header("location: $url");
  exit;
  </code></pre>
  
  <p>Nothing happens though. I can go to the page, but the redirection doesn't take place. I know there should be no source prior to the redirect, and I check the source and it is empty. There are no errors in the PHP log. The code was checked for syntax errors and there are none. </p>
  
  <p>If I comment out the redirect section and use the print statements instead, it works fine. But if I comment out the print statements and try to use the redirect section instead nothing happens. Just a blank screen.</p>
  
  <p>If I slip a</p>
  
  <pre><code>print $url;
  </code></pre>
  
  <p>in just before the header() call naturally it won't redirect then, but I can confirm that the URL appears to be properly formed. There are some spaces in some of the query values though. Could it be that it has to be URL encoded to turn the spaces into %20 or some problem like that?</p>
  
  <p>What might cause the redirect to just not happen?</p>