Forum Moderators: coopster

Message Too Old, No Replies

Excluding site's from stats

         

havoc

2:01 am on Aug 25, 2004 (gmt 0)

10+ Year Member



i am writing a little refer scipt for my references
i am trying to exclude a top level domain's from my stats

now if i wanted to block <whatever>.site.<whatever>
how would i go about it.

the refer comes in a varible called $site

lets say site = "search.site.com" also for a second example "www.site.ch" i need to detect "site" and disregard the refer.

heres the code i have. it isnt working though.
-----------------------------------------------------------
$refered=$_SERVER['HTTP_REFERER'];
$url=parse_url($refered);
$site = $url[host];
// fix some domains
if ($site == "")
{
$site = "No refer";
}

if (preg_match('/^http:\/\/*/i.?site.*/i',$site))
{
$site="badsite";
}
-----------------------------------------------------------
any suggestions?
Thanks
Karl

havoc

12:03 am on Aug 26, 2004 (gmt 0)

10+ Year Member



nevermind i went with strpos to find it . it works now :D