title: How can i get the response of a server using cURL with php?
body: <p>I have a sender script and a receiver script. The sender sends an xml file , while the receiver gets it and stores it in the database.</p>
  
  <p>The sender looks like this :</p>
  
  <pre><code>$xml = file_get_contents("data.xml");
  
    // We send XML via CURL using POST with a http header of text/xml.
    $ch = curl_init();
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "http://localhost/iPM/receiver.php");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
    curl_setopt($ch, CURLOPT_REFERER, 'http://localhost/iPM/receiver.php');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $ch_result = curl_exec($ch);
    echo "Result = ".$ch_result;
    curl_close($ch);
  </code></pre>
  
  <p>and the receiver :</p>
  
  <pre><code>$xml = file_get_contents('php://input');
  
  parsing the xml - storing to database
  etc etc etc etc etc etc etc etc etc
  </code></pre>
  
  <p>I need when i run the sender script , to get back a response from the receiver that everything was ok and the xml file was received. I believed that i would see that with this line of code , in my code :  <code>echo "Result = ".$ch_result;</code>  but the only thing i see printed is <code>Result =</code> .</p>
  
  <p>So what am i doing wrong? What should i add on my sender/receiver to have a response back?</p>