$bot = false;
$path = $_SERVER['QUERY_STRING'];
if ((substr($path, 0, 5) == 'redir')) {
$redir = $_GET['redir'];
}
else {
$redir = "http://www.pristorget.no";
}
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if (($user_agent == 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)') || ($user_agent == 'msnbot/1.0 (+http://search.msn.com/msnbot.htm)') || ($user_agent == 'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)')){$bot=true;}
//logg produkter
if (!$bot){
$find_prod = "prod";
$pos_prod = strpos($redir, $find_prod);
$new_redir = substr($redir, $pos_prod + 5, strlen($redir) - $pos_prod + 5);
$pos_prod_end = strpos($new_redir, ')');
if ($pos_prod != ""){
$prod = substr($new_redir,0,$pos_prod_end);
//echo $prod;
$f_product_log = fopen("product_log.dat","a+") or exit("Unable to open file!");
$input_string = $prod . "\n";
fwrite($f_product_log, $input_string);
fclose($f_product_log);
}
}
//slutt logg produkter
include("hot_products.php");
?>
|