NogDog wrote:PS: Since you are accessing a https:// connection, you may need to add this option:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
Before I added the line to turn SSL VERIFY off this was the error:
damnit
CURL ERROR: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:func(144):reason(134)
So, I added
$ch6 =curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
And now I'm back to getting a blank page.
The updated code is below, any additional advice is appreciated:
<?php
$xml = "<XMLcontent><MoreXML></MoreXML></XMLcontent>";
$ch = curl_init ();
$ch1=curl_setopt ($ch, CURLOPT_URL, "https://www.voipprovider.com/API/1.0/");
$ch2=curl_setopt ($ch, CURLOPT_POST, 1);
$ch3=curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
$ch4=curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$ch5 =curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$ch6 =curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$result = curl_exec($ch);
if (!$result) {echo "<h1>$result damnit</h1>";}
if(!$result) {
echo "<h1>CURL ERROR: " . curl_error($ch) . "</h1>\n";
}
curl_close ($ch);
?>