Use bitrix api to transfer your array data using $ _POST or $ _REQUEST global varibles binding them to your custom form name []. Just add bitrix api code on after submit event. Voting results may be pasted into the custom lead fields that should be previously created in BX manually. Check out this example. It was fully workable and tested.
Код |
---|
<? php $ queryUrl = ''; $ _SERVER ['REMOTE_ADDR'] = $ ip; $ queryData = http_build_query ($ basebitrix24 = array ( 'fields' => array ( "TITLE" => 'one', "NAME" => 'two', "LAST_NAME" => $ leadData ['question_one'], "STATUS_ID" => "NEW", "OPENED" => "Y", "UF_CRM_1491235024" => $ leadData ['question_second'], "UF_CRM_1491235124" => $ leadDataQ1 [$ answer], "UF_CRM_1491235376" => $ leadData ['question_third'], "ASSIGNED_BY_ID" => 16, ' "EMAIL" => array (array ("VALUE" => $ _REQUEST ['email'], "VALUE_TYPE" => "WORK")), ), 'params' => array ("REGISTER_SONET_EVENT" => "Y") )); $ curl = curl_init (); curl_setopt_array ($ curl, array ( CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_POST => 1, CURLOPT_HEADER => 0, CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $ queryUrl, CURLOPT_POSTFIELDS => $ queryData, )); $ result = curl_exec ($ curl); curl_close ($ curl); $ result = json_decode ($ result, 1); ?> |