mail.php 3.29 KB
      <?php



        class PostData
        {

            public function callback()
            {

                $channel = $_COOKIE['cstm_ppc_channel'];
                $campaign = $_COOKIE['cstm_ppc_campaign'];
                $placement = $_COOKIE['cstm_ppc_placement'];
                $keyword = $_COOKIE['cstm_ppc_keyword'];
                $device = $_COOKIE['cstm_ppc_device'];
                $srd = $_COOKIE['srd'];
                $gclid = $_COOKIE['gclid'];
                $cookienum = $_COOKIE['cookienum'];

                $fname = $_REQUEST['fname'];
                $lname = $_REQUEST['lname'];
                $email = $_REQUEST['email'];
                $mobile = str_replace(' ', '', $_REQUEST['mobile']);
                $source = $_REQUEST['source'];
                $message = $_REQUEST['message'];
                $visit_from = $_REQUEST['visit_from'];
                $cc = $_REQUEST['cc'];
                $ip = $_SERVER['REMOTE_ADDR'];

                $duplicate_no = $_COOKIE['checkduplicate'];
                $terms = $_REQUEST['terms'];
                $fbclid = $_COOKIE['fbclid'];

                $fbc = $_COOKIE['_fbc'];
                $fbp = $_COOKIE['_fbp'];
                $cuser = $_COOKIE['c_user'];

                if ($fbc == "") {
                    $fbcidclick = $fbclid;
                } else {
                    $fbcidclick = $fbc;
                }

                if ($terms == "terms") {
                    $wpmsg = true;
                } else {
                    $wpmsg = false;
                }

                // $conf = $_REQUEST['conf'];
                $name = $fname . ' ' . $lname;
                $fullcc = "91" . '' . $mobile;

                
                if ($mobile !== $duplicate_no) {

                    // Google Sheet Interation------------------


                    $postFields = "entry.2001853322=" . $fname;
                    $postFields .= "&entry.1189647193=" . $email;
                    $postFields .= "&entry.1227321992=" . $mobile;
                    $postFields .= "&entry.1632349928=" . urlencode($project_name);
                    $postFields .= "&entry.1660010704=" . $source;

                    $postFields .= '&entry.865191081=' . urlencode($_COOKIE['cstm_ppc_campaign']);
                    $postFields .= '&entry.831134418=' . urlencode($_COOKIE['cstm_ppc_channel']);
                    $postFields .= '&entry.597222109=' . urlencode($_COOKIE['cstm_ppc_keyword']);
                    $postFields .= '&entry.1223438499=' . urlencode($_COOKIE['cstm_ppc_placement']);
                    $postFields .= '&entry.2011391976=' . urlencode($_COOKIE['cstm_ppc_device']);
                    $postFields .= '&entry.2011391976=' . urlencode($_COOKIE['cstm_ppc_device']);
                    $postFields .= '&entry.2005032838=' . $gclid;
                    $postFields .= '&entry.1633429=' . $ip;


                    $ch3 = curl_init();
                    curl_setopt($ch3, CURLOPT_URL, "");
                    curl_setopt($ch3, CURLOPT_POST, 1);
                    curl_setopt($ch3, CURLOPT_POSTFIELDS, $postFields);
                    curl_setopt($ch3, CURLOPT_HEADER, 0);
                    curl_setopt($ch3, CURLOPT_RETURNTRANSFER, true);
                    $result3 = curl_exec($ch3);

                }
            }
        }
        ?>