Advertisement
bender-nvkz

Untitled

Aug 5th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. $url = 'http://api.wiseadvice.ru/erp/v1/pushordertoerp';
  2. $data = array(
  3. 'direction' => '000000002',
  4. 'name' => '(none)',
  5. 'companyName' => '(none)',
  6. 'phone' => '(none)',
  7. 'email' => '(none)',
  8. 'comment' => '(none)',
  9. 'inUrl' => '(none)',
  10. 'timestamp' => date_timestamp_get(date_create()),
  11. 'clientId' => '(none)',
  12. 'referrer' => '(none)',
  13. 'utmTerm' => '(none)',
  14. 'utmContent' => '(none)',
  15. 'utmCampaign' => 'test',
  16. 'utmSource' => 'FP',
  17. 'utmMedium' => 'FP',
  18. );
  19.  
  20. $options = array(
  21. 'http' => array(
  22. 'header' => "Content-type: application/json\r\n",
  23. 'method' => 'POST',
  24. 'content' => json_encode($data)
  25. )
  26. );
  27. $context = stream_context_create($options);
  28. $result = file_get_contents($url, false, $context);
  29. if ($result === false) { }
  30.  
  31. echo'<pre>';print_r($data);echo'</pre>';
  32. var_dump($result);
  33.  
  34. die;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement