tags:

views:

316

answers:

2

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..

thanks.

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

It's simple enough.

Unkwntech
A: 

fair enough..

thanks for helping..

do you by another hand know any good open source referal script?

For what? are you looking for something to provide links to referers like: mysite.com/?referer=othersite.com, and will log it.
Unkwntech
yeah thats it ..