I have created two distinctly different stats tools, I now need to have some sort of mechanism to make sure the right stats page is called.
I have the following so far
Code: Select all
$pageurl = //Some value from Referer
$page = explode("/", $pageurl);
$oururl = $page[2];
$siteone = "www.url1.co.uk";
$sitetwo = "www.url2.com";
$sitethr = "www.url3.co.uk";
$siteslist = array($siteone, $sitetwo, $sitethr);
if (in_array($oururl,$siteslist, TRUE)){
$recordhits = "True";
//Do something relating to these urls
} else {
// not found in string
// Do the other scripts
$recordhits = "False";
}
Should I do the array and coding above in an include and just wrap the If else differently in each file, because I want to keep each stats file separate or is there another way to achieve the same goal?
Any suggestions would be welcome.
Steve