title: Post and get result with PHP
body: <p>From a PHP page, I'm trying to POST some data to another PHP page and get data back.</p>
  
  <p>Here is what I currently have:</p>
  
  <pre><code>&lt;?php 
  // Initialize cURL session
  $ch = curl_init('postpage.php');
  
  // Set some options on the session
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, array('field1' =&gt; 'Andrew'));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
  // Execute post
  $result = curl_exec($ch);
  
  var_dump($result);
  
  // Close the session
  curl_close($ch);
  ?&gt;
  </code></pre>
  
  <p>and in postpage.php:</p>
  
  <pre><code>&lt;?php
  echo 'Receipt of post request. field1:'.$_POST["field1"];
  ?&gt;
  </code></pre>
  
  <p>All the var_dump gives me is this:</p>
  
  <pre><code>string(0) "" 
  </code></pre>
  
  <p>Why am I not getting the text back?</p>
  
  <p>Thanks!</p>