FSBtoERP - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of FSBtoERP.php

  1. <?php
  2. add_action( 'wpcf7_mail_sent', 'your_wpcf7_mail_sent_function' );
  3. function your_wpcf7_mail_sent_function( $contact_form ) {
  4.    
  5.  
  6.         $ch = curl_init();
  7.         curl_setopt_array($ch , array(
  8.         CURLOPT_URL            => 'https://education-erp.com/api/LandingService/v1/SingleRequest' ,
  9.         CURLOPT_POST           => true ,
  10.         CURLOPT_RETURNTRANSFER => true ,
  11.         CURLOPT_CUSTOMREQUEST  => "POST" ,
  12.         CURLOPT_POSTFIELDS     => http_build_query(array(
  13.             "CityId" => null,
  14.             "SchoolId" => 16348,
  15.             "Name" => 'Алексей Тест',
  16.             "ChildName" => null,
  17.             "Phone" => '+71231230000',
  18.             "Type" => 2,
  19.             "Email" => null,
  20.             "SchoolType" => null,
  21.             "UtmSource" => null,
  22.             "UtmCampaign" => null,
  23.             "UtmContent" => null,
  24.             "UtmMedium" => null,
  25.             "UtmTerm" => null,
  26.             "PromoCode" => null,
  27.             "Comment" => null
  28.  
  29.         ))
  30.       ));
  31.       $responseData = json_decode(curl_exec($ch)); // ответ от сервера
  32.  
  33.  
  34.       curl_close($ch);
  35.    
  36.   }
File Description
  • FSBtoERP
  • PHP Code
  • 21 Sep-2022
  • 1.1 Kb
You can Share it: