Advertisement
Guest User

обработчик

a guest
Jan 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.42 KB | None | 0 0
  1. <?php
  2.  if (!empty($_POST['phone'])) {
  3.         send_the_order ($_POST);
  4.     }
  5.     function send_the_order ($post){
  6.         $params=array(
  7.             'flow_hash' => $post['7yjV'],
  8.             'landing' => $post['hondrocream-health.com'],
  9.             'phone' => $post['phone'],
  10.             'name' => $post['name'],
  11.             'country' => $post['IT'],
  12.             'referrer' => $post['referrer'],
  13.             'address' => $post['address'],
  14.             'email' => $post['email'],
  15.             'lastname' => $post['lastname'],
  16.             'comment' => $post['comment'],
  17.             'layer' => $post['layer'],
  18.             'sub1' => $post['sub1'],
  19.             'sub2' => $post['sub2'],
  20.             'sub3' => $post['sub3'],
  21.             'sub4' => $post['sub4'],
  22.             'sub5' => $post['sub5'],
  23.         );
  24.         $url = 'http://leadbit.com/api/conversion/new-from-form';
  25.         $ch = curl_init();
  26.         curl_setopt($ch, CURLOPT_URL, $url);
  27.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  28.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  29.         curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
  30.         curl_setopt($ch, CURLOPT_REFERER, $url);
  31.         curl_setopt($ch, CURLOPT_POST, 1);
  32.         curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
  33.         $return= curl_exec($ch);
  34.         curl_close($ch);
  35.         $array=json_decode($return, true);
  36.         header('Location:'.$post['success_page']);
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement