cookies question
Posted: Thu Nov 10, 2005 11:41 am
I have never used cookies before.
If I have 100 surfers coming from a certain domain, how do I give them all their own cookies so that for every 7th click for each surfer they are redirected to some random site?
is it as easy as this? Include this code in main page
for each link I make them like this
http://www.domain.com/out.php?url=http: ... dress.html
and inside each out.php
If I have 100 surfers coming from a certain domain, how do I give them all their own cookies so that for every 7th click for each surfer they are redirected to some random site?
is it as easy as this? Include this code in main page
Code: Select all
setcookie ("links", "0");http://www.domain.com/out.php?url=http: ... dress.html
and inside each out.php
Code: Select all
if ($_COOKIE['links']==7)
{
// redirect code goes here
$_COOKIE['links']++
}
else
{
// go to value inside url variable
$_COOKIE['links']++
}