I have been struggling mightily over what is probably a simple question. The web is filled with Curl examples that show how to post something to another script and get a response. I've tried lots of variations and can't get anything back on the response. The response does not include any data and does not include any curl error information. I've tried to boil this down to a very simple scenario which I've demonstrated in the two scripts below. Both scripts run on the same server. The first initiates a post request to send a simple xml string and the second is simply echoing something back.
$post_string = '<?xml version="1.0" encoding="UTF-8"?>
$url = "http://bsmsoftware.us/test2.php";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); //Don't verify ssl certificate
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
$reply = curl_exec($ch);
if ($reply!== false) echo $reply; else echo curl_error($ch);
<? print_r($_post); ?>
Like I said, I've been struggling with this for awhile, so I'm looking forward to some help.