where is the error? <?php
header('Access-Control-Allow-Origin: *');
include 'FeedbackForm.php';
include 'FeedbackProcessorCrm.php';
$postData = file_get_contents('php://input');
$data = json_decode($postData, true);
/*
// для тесте
$data = ['phone' => 71234567890, 'url' => 'https://dmp.one/?yclid=3725717487900465674', 'email' => ["test@test.test"] ];
*/
$ym_uid = $_COOKIE['_ym_uid'];
$phone = $data["phone"];
$email = $data["email"][0];
$noemail = 'noemail+'.$phoneemail.'@gmail.com';
$website = $data["website"];
$referer = $data["referer"];
$utm_source = $data["utm_source"];
$utm_medium = $data["utm_medium"];
$utm_campaign = $data["utm_campaign"];
$utm_term = $data["utm_term"];
$utm_content = $data["utm_content"];
$date = date('Y-m-d') . ' ' . $time = date('H:i:s');
$url = "https://$website/?utm_source=$utm_source&utm_medium=$utm_medium&utm_campaign=$utm_campaign&utm_term=$utm_term&utm_content=$utm_content";
$logtext .= "\"$phone\";\"$email\";\"$url\";\"$referer\";\"$website\";\"$date\";\"$ym_uid\"\n";
$logtext = "$logtext";
// определяем директорию, куда писать, из названия домена:
$site = parse_url($url, PHP_URL_HOST);
$site = preg_replace('/[^ a-z\d]/ui', '',stristr($site, '.', true) );
// создаём директорию:
if (!is_dir('logs/' . $site)) {
  mkdir('logs/' . $site);
}
file_put_contents(__DIR__ . '/logs/'.$site.'/data.csv', print_r($logtext,true), FILE_APPEND);
if ( $site === 'new' || $site == 'actionmarketing' && $phone > 0) {
 $code = '2505';
 // для ODP:
 $bitrixid = '0';
 $day = date('Y-m-d');
 $time = date('H:i:s');
 // заявки Актион-Маркетинг в ODP:
 $data = [
  "bitrixid" => $bitrixid,
  "phone" => $phone,
  "url" => $url
  ];
 $data_string = json_encode ($data, JSON_UNESCAPED_UNICODE);
 print_r($data_string);
 $curl = curl_init('http://basis.inkerting.ru/action/add_candidate.php');
 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
 curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);
 // Принимаем в виде массива. (false - в виде объекта)
 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
      'Content-Length: ' . strlen($data_string))
 );
 $result = curl_exec($curl);
 print_r($result);
 curl_close($curl);
} else if ( $site === 'bizprogress' ) {
 $code = '15004';
} else if ( $site === 'boxberry' ) {
 $code = '14372';
} else if ( $site === 'equeo' ) {
 $code = '15005';
} else if ( $site === 'klinikon' ) {
 $code = '14889';
} else if ( $site === 'euroauto' ) {
 $code = '15500';
} else if ( $site === 'joompro' ) {
 $code = '15952';
} else if ( $site === 'makves' ) {
 $code = '16191';
} else if ( $site === 'panaceadoc' ) {
 $code = '16472';
} else if ( $site === 'ns23' ) {
 $code = '16336';
} else if ( $site === 'scloud' ) {
 $code = '16192';
} else if ( $site === 'mrdoors' ) {
 $code = '16118';
} else if ( $site === 'strategs' ) {
 $code = '16453';
} else {
 $code = '2505';
}
if (isset($phone) and strlen($phone) > 0) {
    $feedback = new FeedbackForm();
    $feedback->name = 'Не указано';
    $feedback->BitrixId = '0';
    $feedback->phone = $phone;
    $feedback->email = (isset($email) ? $email : $noemail);
    $feedback->comment = '';
    $feedback->url = $url;
    $feedback->code = $code;
    $sendcrm = new FeedbackProcessorCrm();
 if ($sendcrm->send($feedback)) {
  echo "Спасибо, ваша заявка принята";
 } else {
  echo "Повторите отправку заявки позже";
 }
} else {
 echo "Нет номера телефона";
}