[ [ 'name' => 'firstname', 'value' => $_POST['name'] ], // [ // 'name' => 'lastname', // 'value' => '' // ], [ 'name' => 'email', 'value' => $_POST['email'], ], [ 'name' => 'phone', 'value' => $_POST['phone'], ], [ 'name' => 'strona_www_firmy', 'value' => $_POST['www_firmy'] ], [ 'name' => 'LEGAL_CONSENT.subscription_type_8488293', 'value' => $_POST['checkbox-1'] ? 'true' : 'false' ], [ 'name' => 'LEGAL_CONSENT.processing', 'value' => $_POST['checkbox-2'] ? 'true' : 'false' ] ], 'context' => [ 'hutk' => $hubspotutk, 'pageUri' => 'https://zaufane.pl/', 'pageName' => 'zaufane.pl' ], 'legalConsentOptions' => [ 'consent' => [ 'content' => 'By submitting this form, you agree that we may use the data you provide to contact you with information related to your request/submission and the relevant LinkedIn product. If you are a LinkedIn member, you can control the messages you receive from LinkedIn in your settings. If you are a guest, you can unsubscribe from LinkedIn marketing emails at any time by clicking the unsubscribe link in the email. To learn more, see LinkedIn\'s Privacy Policy.', 'consentToProcess' => true, 'text' => 'I agree to the processing of my personal data by LinkedIn.', 'communications' => [ [ 'value' => true, 'subscriptionTypeId' => 7094950, 'text' => 'I agree to receive marketing communications from LinkedIn.' ] ] ] ] ]; $jsonData = json_encode($postData); // Initialize cURL $ch = curl_init($hubspot_url); // Set cURL options curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData); // Execute cURL request $response = curl_exec($ch); // Check for errors if ($response === false) { $error = curl_error($ch); echo "cURL Error: $error"; } else { // Decode response $responseData = json_decode($response, true); if (isset($responseData['inlineMessage'])) { echo "
" . $responseData['inlineMessage'] . '
" . $response . '