Page 1 of 1

How to call different pages

Posted: Wed Feb 25, 2009 8:16 am
by cornishcat
Hi,
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";
    }
 
However since I'm an ASP programmer, I would have done a response.redirect in the If Else script, but that isn't the same in PHP, so my question is:-
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