hoi Bert-jan
ik zie 2 verschillende ur\'l\'s in je voorbeeld.
ik heb een voorbeeld waarbij de output in een string wordt gezet en er wordt een timeout toegevoegd.
$xml_string = urlencode($xml_string);
$url = \"https://www.sielsystems.nl/acumulus/api/add_invoice.php\";
$ch = curl_init(); //Initialize
curl_setopt($ch, CURLOPT_URL, $url); //Set url
curl_setopt($ch, CURLOPT_POST, 1); //Regular post
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //Return a var
curl_setopt($ch, CURLOPT_TIMEOUT, 10); // 10sec time out
curl_setopt($ch, CURLOPT_POSTFIELDS, \"xmlstring=$xml_string\"); //Add fields to post
$result = curl_exec($ch); // execute the post
// Check for errors
if(curl_errno($ch))
{
Die(\'Curl error: \' . curl_error($ch));
}
curl_close($ch); //Close and Free
echo $result; //output result
?>