title: fsockopen() and header(location:xxx) in opened script?
body: <p>strange problem, i'm opening a connection with <code>fsockopen()</code> to a page, 
  that page has a <code>header(location:xx)</code> to the same page (i'm just refreshing the script), but it'seems that the redirect isn't working...</p>
  
  <p>obviously everything is working if i'm replicating it with a browser...</p>
  
  <p>some code:</p>
  
  <p>CONNECTION PAGE:</p>
  
  <pre><code>$socketcon = fsockopen($_SERVER['HTTP_HOST'],80,$errorno,$errorstr,10);
  if($socketcon) {
      $socketdata = "GET http://www.example.com/test2.php HTTP/1.0\r\nHost: ".$_SERVER['HTTP_HOST']."\r\nConnection: Close\r\n\r\n";
      fwrite($socketcon,$socketdata); 
      fclose($socketcon);
  }
  </code></pre>
  
  <p>CONNECTED PAGE (test2.php):</p>
  
  <pre><code>&lt;?
  //other code (working fine)
  
  if($_GET["AAA"]){
  
       //REDIRECT WORKED !
  
  } else {
       header("location:test2.php?AAA=1");   //same page but with a get param
  }
  ?&gt;
  </code></pre>
  
  <p>the REDIRECT WORKED part never get executed...</p>
  
  <p>any suggestions ? </p>
  
  <p>EDIT: the connection MUST be asynchronous</p>