Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <?php
  2. //Данные для передачи
  3. $name = $_POST['name'];
  4. $phone = $_POST['phone'];
  5. $flow = '5LVV'; //Код потока
  6. $token = '4c24536a4c7c325743526d25636c7b47'; //Token
  7. $country = 'ro'; //Код страны
  8. $landing = $_POST['landing']; //Ссылка на лендинг в системе
  9. $referrer = 'http://healthynewsworld.club'; //Ссылка на лендинг с которого льете
  10.  
  11. $params = array(
  12.  
  13. 'name' => $name,
  14. 'phone' => $phone,
  15. 'landing' => $landing,
  16. 'flow_hash' => $flow,
  17. 'country' => $country,
  18. 'referrer' => $referrer
  19.  
  20. );
  21.  
  22. if (!empty($_POST['phone'])) {
  23. send_the_order ($_POST);
  24. }
  25. function send_the_order ($post){
  26. $params=array(
  27. 'flow_hash' => $post['flow_hash'],
  28. 'landing' => $post['landing'],
  29. 'referrer' => $post['referrer'],
  30. 'phone' => $post['phone'],
  31. 'name' => $post['name'],
  32. 'country' => $post['country'],
  33. );
  34. $url = 'http://leadbit.com/api/new-order/{token}';
  35. $ch = curl_init();
  36. curl_setopt($ch, CURLOPT_URL, $url);
  37. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  38. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  39. curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
  40. curl_setopt($ch, CURLOPT_REFERER, $url);
  41. curl_setopt($ch, CURLOPT_POST, 1);
  42. curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
  43. $return= curl_exec($ch);
  44. curl_close($ch);
  45. $array=json_decode($return, true);
  46. header('Location:'.$post['success_page']);
  47. }
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement