简体   繁体   English

跟踪用户推荐(PHP / MySQL)

[英]Tracking users referral (PHP / MySQL)

Greetings, 问候,

Is there any script that keep track users referral and set cookie on users referred so whenever they leave site and come back, it still will be count as referred by person.. 是否有任何脚本可以跟踪用户的引荐,并在被引荐的用户上设置cookie,因此无论何时他们离开站点并返回,它仍将被计为个人引荐。

thanks. 谢谢。

//To set the cookie
if($refered)
 {
    setcookie('sitenameReferal', 'REFERER');
 }
//To retrieve it
if($_COOKIE['sitenameReferal'])
 {
    $referedBy = $_COOKIE['sitenameReferal'];
 }

It's simple enough. 很简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM