title: Execute and POST data to a PHP script from a PHP script without waiting and no exec
body: <p>I have 2 scripts called "scriptA.php" and "scriptB.php"</p>
  
  <p>I need to be able to start "scriptB.php" from within "scriptA.php" and make it so the browser isn't waiting for "scriptB.php" to fully complete. I don't want to wait for the script to fully finish, I just want it to finish on its own. I still need to be able to do a POST or to pass data from "scriptA.php" to "scriptB.php" when the script is being executed to be ran.</p>
  
  <p>I can <strong>NOT</strong> use exec, shell_exec or any variation of command line.</p>
  
  <p><strong><em>EDIT - Trying cURL option</em></strong></p>
  
  <p>Here are my 2 scripts...</p>
  
  <p>scriptA.php</p>
  
  <pre><code>    $url = 'scriptB.php';
      $data = array('foo'=&gt;'bar',
            'baz'=&gt;'boom',
            'cow'=&gt;'milk',
            'php'=&gt;'hypertext processor');
  
       $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_USERAGENT, 'curl');
      curl_setopt($ch, CURLOPT_TIMEOUT, 1);
      $result = curl_exec($ch);
      curl_close($ch);
  </code></pre>
  
  <p>scriptB.php</p>
  
  <pre><code>ignore_user_abort(true);
  set_time_limit(0);
  $fp = fopen("myTexts.txt","wb");
  
      $content = "blah -&gt;" . $_GET['foo'];
  fwrite($fp,$content);
  fclose($fp);
      exit;
  </code></pre>
  
  <p>scriptB.php isn't being called.  I called scriptB.php to test to make sure it works, and when I go to the page directly it does work.  it does write to the file correctly.  Just when i run scriptA.php it isn't being executed.</p>