Im trying to get curl to post some info to an ssl server. I've compiled php with curl support turned on and it says curl is install with openssl in phpinfo(). Here is the code ive been using. Any help is appriciated.
Brian
//path to https post
$strURL = "https://mydomain.com/mailinglist.php";
$strRequestBody= "bass=12";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_URL, $strURL);
curl_setopt ($ch, CURLOPT_POST, $strRequestBody);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 45); //times out after 4s
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $strRequestBody);
$return_string = curl_exec ($ch);
curl_close ($ch);
echo($return_string);