I am sending XML by POST to som adress, code:
Code: Select all
$xml_sms=$apXmlWriter->output();
//Gateway user and pass
$user= '11';
$pass= '11';
function send_sms($xml_sms, $username, $password)
{
$Curl_Session = curl_init('http://www.mobilelocal.com/xxx/xxx');
curl_setopt ($Curl_Session, CURLOPT_USERPWD,"$username:$password");
curl_setopt ($Curl_Session, CURLOPT_FORBID_REUSE, true);
curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, true);
curl_setopt ($Curl_Session, CURLOPT_MAXREDIRS, 1);
curl_setopt ($Curl_Session, CURLOPT_TIMEOUT, 30);
curl_setopt ($Curl_Session, CURLOPT_POST, true);
curl_setopt ($Curl_Session, CURLOPT_POSTFIELDS, $xml_sms);
$result = curl_exec ($Curl_Session);
curl_close ($Curl_Session);
return $result;
}
$answer=send_sms($xml_sms, $user, $pass);
echo '<pre>answer', print_r($answer, true), '</pre>';
But my partner say that there are a lot of submit entrys in his logs, and then I send XML hi said: "every time we test its just a lot of messages again". Is it possible? Because I send only on time. Maybe in Curl there is some options and I must set this options for send request only one time? Because I don't understand there is the loop in this code
Thank you