Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.47 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' => 'd3aV',
  8.             'landing' => $post['landing'],
  9.             'phone' => $post['Phone'],
  10.             'name' => $post['Name'],
  11.             'country' => 'ro',
  12.             'referrer' => isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "",
  13.             'address' => $post['address'],
  14.             'email' => $post['email'],
  15.             'lastname' => $post['lastname'],
  16.             'comment' => $post['comment'],
  17.             'layer' => $post['layer'],
  18.             'sub1' => $post['utm_source'],
  19.             'sub2' => $post['utm_medium'],
  20.             'sub3' => $post['utm_campaign'],
  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.     }
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement