E
E
efo82021-07-20 13:52:26
PHP
efo8, 2021-07-20 13:52:26

How to pass $name type variable to CRM?

I have implemented sending a form on wordpress through contact form 7.
There was a need to transfer these requests to custom CRM.
I figured out how to get $name type variables from the form, but I can't figure out how to pass this data to CRM.

There are variables:
$name
$phone
$msg

and code from CRM

<?
//Для работы необходим Curl
$ch = curl_init();
curl_setopt_array($ch , array(
  CURLOPT_URL            => 'http://medvedev.intrumnet.com/onlineforms' ,
  CURLOPT_POST           => true ,
  CURLOPT_RETURNTRANSFER => true ,
  CURLOPT_CUSTOMREQUEST  => "POST" ,
  CURLOPT_POSTFIELDS     => http_build_query(array(
    "action"   => "fillform" ,
    "formtype" => 15 ,
    "data"     => array(
      "def_customer" => array(
        "name" => $_POST[ "form" ][ '15' ][ "def_customer" ][ "name" ] ,
        "phone" => $_POST[ "form" ][ '15' ][ "def_customer" ][ "phone" ]
      ) ,
      "ext_customer" => array(
        "429" => array(
          "type"  => "text" ,
          "value" => $_POST[ "form" ][ '15' ][ "ext_customer" ][ 429 ] /* Прочая информация */
        )
      )
    ) ,
    "ihistory" => $_POST[ 'intrum_stat_history' ] /* Используется для получения данных статистики посетителя сайта, отправившего онлайн-форму, например: источник входа, история просмота страниц и т. д. Вставьте в HTML-форму код, размещённый в пункте &quot;Пример формы в HTML&quot; ниже */
  ))
));
$responseData = json_decode(curl_exec($ch)); // ответ от сервера
curl_close($ch);
echo rawurldecode('%D0%A4%D0%BE%D1%80%D0%BC%D0%B0%20%D1%83%D1%81%D0%BF%D0%B5%D1%88%D0%BD%D0%BE%20%D0%BE%D1%82%D0%BF%D1%80%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B0');
?>


How to correctly substitute the script data? for everything to work correctly.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question