Материал из BiTel WiKi
<?php
$bg_url = "https://billing.host.ru:443/bgbilling/executer";
$login = "actionlogin";
$password = "12345678";
function http_post($url, $login, $password, $request) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // Need for SSL connection
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "$login:$password");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
$post = "module=tariff&action=PreTariffing&cid=156&sid=20&type=1&amount=5&debug=1";
echo http_post($bg_url, $login, $password, $post),"\n";
?>