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.
Result of php executing
Full code of FSBtoERP.php
- <?php
- add_action( 'wpcf7_mail_sent', 'your_wpcf7_mail_sent_function' );
- function your_wpcf7_mail_sent_function( $contact_form ) {
- $ch = curl_init();
- curl_setopt_array($ch , array(
- CURLOPT_URL => 'https://education-erp.com/api/LandingService/v1/SingleRequest' ,
- CURLOPT_POST => true ,
- CURLOPT_RETURNTRANSFER => true ,
- CURLOPT_CUSTOMREQUEST => "POST" ,
- CURLOPT_POSTFIELDS => http_build_query(array(
- "CityId" => null,
- "SchoolId" => 16348,
- "Name" => 'Алексей Тест',
- "ChildName" => null,
- "Phone" => '+71231230000',
- "Type" => 2,
- "Email" => null,
- "SchoolType" => null,
- "UtmSource" => null,
- "UtmCampaign" => null,
- "UtmContent" => null,
- "UtmMedium" => null,
- "UtmTerm" => null,
- "PromoCode" => null,
- "Comment" => null
- ))
- ));
- $responseData = json_decode(curl_exec($ch)); // ответ от сервера
- curl_close($ch);
- }