Hi there,
I need advice. I have a script that I'm working on and I've got it to work fine and all, but I just want to tweak it just a little and I have no idea what to call what i want to do. I think it may have something to do with the IF THEN ELSE statements, but I'm not sure how....
Let me show you what I mean:
The script is a referer logger and it is as follows:
$referer = $HTTP_REFERER;
$ip = $REMOTE_ADDR; //Their IP address
$when = date ("d/m/Y"); //The date they visited
$host = gethostbyaddr($ip); //Who's their host?
$page = $SCRIPT_NAME; //The page they're accessing.
//some info about my site
$mydomain = "mydomain.com"; //the addy to my domain
$myserver = "11.11.11.11"; //the IP address to my site
$google = "google.com"; //the addy to google
It then goes on to say, if they haven't come from my domain (and my site's IP address) AND they haven't come from www.google.com then log them:
if (($referer) and (!strstr($referer, $mydomain)) and (!strstr($referer, $myserver)) and (!strstr($referer, $google)))
Because there's a number of different version of google (www.google.it, uk.google.yahoo.co etc) I want to include all those into the $google variable.
How would I go about doing that? I'm thinking its going to be painfully simple, I just can't think how at the moment.
If you can point me to the right spot in the manual I should be looking I'd be greatly appreciative!
Brad