send_leads.php
2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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'];
$gclid = $_COOKIE['gclid'];
$srd = $_COOKIE['srd'];
$utm_source = $_COOKIE['utm_source'];
$fbclid = $_COOKIE['fbclid'];
$fbc = $_COOKIE['_fbc'];
$fbp = $_COOKIE['_fbp'];
$fbcidclick = $_COOKIE['fbcidclick'];
$fname = $_REQUEST['fname'];
$lname = $_REQUEST['lname'];
$email = $_REQUEST['email'];
$mobile = str_replace(' ', '', $_REQUEST['mobile']);
$source = $_REQUEST['source'];
$message = $_REQUEST['message'];
$unit_type = $_REQUEST['unit_type'];
//$country_code = $_REQUEST['country_code'];
$name = $fname . ' ' . $lname;
$fullmobile = "91" . $mobile;
if ($fbc == "") {
$fbcidclick = $fbclid;
} else {
$fbcidclick = $fbc;
}
// Google Sheet Interation------------------
$postFields = "entry.449648499=" . $name;
$postFields .= "&entry.1379833540=" . $email;
$postFields .= "&entry.758332158=" . $fullmobile;
$postFields .= "&entry.1900106466=" . $srd;
$postFields .= "&entry.1693361781=" . $source;
$postFields .= "&entry.94323770=" . $unit_type;
$postFields .= '&entry.1830911442=' . urlencode($_COOKIE['cstm_ppc_campaign']);
$postFields .= '&entry.939490048=' . urlencode($_COOKIE['cstm_ppc_channel']);
$postFields .= '&entry.729166844=' . urlencode($_COOKIE['cstm_ppc_keyword']);
$postFields .= '&entry.839903606=' . urlencode($_COOKIE['cstm_ppc_placement']);
$postFields .= '&entry.2003337495=' . urlencode($_COOKIE['cstm_ppc_device']);
$ch3 = curl_init();
curl_setopt($ch3, CURLOPT_URL, "https://docs.google.com/forms/u/0/d/e/1FAIpQLSd6sYbPGRcEEvbYGhWkx_0Jr7ZWJ_uRvhkJOD9XsoJR2bNSXQ/formResponse");
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);
// do not delete
return true;
}
}