如何使用postbackurl进行联属会员跟踪转换?

时间:2017-07-04 05:40:22

标签: php tracking postbackurl

如何使用postbackurl进行联属会员跟踪转换? 我在主要附属网络上发布的这样的回发网址

http://funto.xyz/ajax.php?uid=29&oid=45&offerid=4069&sub_id=#s2#

我正在尝试得到这样的回复,但没有回复请帮助如何跟踪转化

if(isset($_GET['uid']) && isset($_GET['oid']) && isset($_GET['offerid']) && isset($_GET['sub_id'])){
    $uid = $_GET['uid'];
    $oid = $_GET['oid'];
    $offerid = $_GET['offerid'];
    $s2 = $_GET['sub_id'];
    //$uri_parts = explode('?', $_SERVER['REQUEST_URI'], 2);
    //$myurl= 'http://' . $_SERVER['HTTP_HOST'] . $uri_parts[0].'?s1='.$sub_id.'&uid='.$uid.'&oid='.$oid;
    $reffer = $_SERVER["HTTP_REFERER"];
    $ip = $_SERVER['REMOTE_ADDR'];
    $subid = time();
    setcookie($s2, $s2, time() + (86400 * 30), "/");
    $details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
    $ip = $details->ip;
    $country = $details->country;
    $datetime = date('Y-m-d H:i:s');
    $date = date('Y-m-d');
    $query="INSERT INTO clicks (uid,oid,offerid,subid,clicks,signup,reffer_link,ip,country,proxy, date,datetime) VALUES ('$uid','$oid','$offerid','$subid','1','$s2','$reffer','$ip','$country','proxy', '$date','$datetime')";
    $result = mysqli_query($con,$query)  or die("Error: ".mysqli_error($con));

    if ($result == 1){
        $qry = "select offername from offers where oid = '$oid'";
        $run = mysqli_query($con, $qry) or die(mysqli_error($con));
        $res = mysqli_fetch_array($run);
        $link = $res['offername'].$subid;
        //$myurl= 'http://' . $_SERVER['HTTP_HOST'] . $uri_parts[0].'?s1='.$sub_id
         //header ("Loca`enter code here`tion: $myurl");
        header ("Location: $link");

        }

}

0 个答案:

没有答案