Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- const API = '4c24536a4c7c325743526d25636c7b47';
- const API_URL = "http://leadbit.com/api/new-order/" . API;
- const FLOW_HASH = 'gjjV'; // хеш потока
- const LANDING = 'http://th5.forfun.maxisize-pro.com';
- const COUNTRY = 'TH';
- $fbpixel = $_REQUEST['fbp'] ? $_REQUEST['fbp'] : 0;
- $isCurlEnabled = function () {
- return function_exists( 'curl_version' );
- };
- if ( ! $isCurlEnabled ) {
- echo "<pre>";
- echo "pls install curl\n";
- echo "For *unix open terminal and type this:\n";
- echo 'sudo apt-get install curl && apt-get install php-curl';
- die;
- }
- $args = [
- 'flow_hash' => FLOW_HASH,
- 'landing' => LANDING,
- 'phone' => $_REQUEST['phone'],
- 'name' => $_REQUEST['name'],
- 'country' => COUNTRY,
- 'referrer' => isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "",
- 'sub1' => $_REQUEST['subid1'],
- 'sub2' => $_REQUEST['subid2'],
- 'sub3' => $_REQUEST['subid3'],
- 'sub4' => $_REQUEST['subid4'],
- 'sub5' => $_REQUEST['subid5'],
- ];
- $curl = curl_init();
- curl_setopt_array( $curl, array(
- CURLOPT_URL => API_URL,
- CURLOPT_POST => true,
- CURLOPT_POSTFIELDS => $args,
- CURLOPT_RETURNTRANSFER => true
- ) );
- $res = curl_exec( $curl );
- curl_close( $curl );
- $res = json_decode( $res, true );
- if ( $res['status'] !== 'fail' ) {
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport"
- content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title style="text-align: center">Your order is accepted!</title>
- <?php if($fbpixel !== 0) : ?>
- <!-- Facebook Pixel Code -->
- <script>
- !function (f, b, e, v, n, t, s) {
- if (f.fbq)return;
- n = f.fbq = function () {
- n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments)
- }
- ;
- if (!f._fbq) f._fbq = n;
- n.push = n;
- n.loaded = !0;
- n.version = '2.0';
- n.queue = [];
- t = b.createElement(e);
- t.async = !0;
- t.src = v;
- s = b.getElementsByTagName(e)[0];
- s.parentNode.insertBefore(t, s)
- }(window,
- document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');
- fbq('init', <?php echo $fbpixel; ?>); // Insert your pixel ID here.
- fbq('track', 'PageView');
- </script>
- <noscript><img height="1" width="1" style="display:none"
- src="https://www.facebook.com/tr?id=<?php echo $fbpixel; ?>&ev=PageView&noscript=1"
- /></noscript>
- <!-- DO NOT MODIFY -->
- <!-- End Facebook Pixel Code -->
- <?php endif;?>
- </head>
- <body>
- <?php if($fbpixel !== 0) : ?>
- <script>
- fbq('track', 'Lead');
- </script>
- <?php endif;?>
- <h1>Your order is accepted!</h1>
- </body>
- </html>
- <?php
- } else {
- var_dump($res);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement