title: Posting JSON using CURL then go to the posted page
body: <p>I have a set of php processing pages that interact together by passing data via get, but now I have to pass JSON between a couple of the processing pages and need the same functionality as when using GET.</p>
  
  <p>The current working get method:</p>
  
  <pre><code>//The guts
  
  header("Location: $moreprocessing_url/?userid=$id");
  
  exit();
  </code></pre>
  
  <p>Then in the moreprocessing_url picks up:</p>
  
  <pre><code>$userid = $_GET[id];
  
  //More guts
  
  $something = 'important';
  
  header("Location: $public_url/?something=$something");
  
  exit();
  </code></pre>
  
  <p>So now in the first processing page, instead of sending a simple string, I need to send JSON - so I am using CURL to post the JSON - but after the post I would like the page being posted to to continue the processing and have the original page stop.  The same way the above code works but using CURL/post instead.  Maybe my understanding of CURL isn't strong enough and this just isn't possible?</p>
  
  <p>My CURL:</p>
  
  <pre><code>$curl = curl_init($moreprocessing_url);
  curl_setopt($curl, CURLOPT_HEADER, false);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
  curl_setopt($curl, CURLOPT_HTTPHEADER,
  array("Content-type: application/json"));
  curl_setopt($curl, CURLOPT_POST, true);
  curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
  
  curl_exec($curl);
  curl_close($curl);
  
  exit();
  </code></pre>
  
  <p>So this returns to the current page where the CURL is happening and not the moreprocessing_url which I want -- is this possible?  Basically I want the page being posted to, to take over and the one sending the CURL to stop.</p>