$value ) { $TEMPLATE = str_replace("##$key##", $value, $TEMPLATE); } if( is_numeric($_GET['ID']) ) { $value = $_GET['ID']; $cookie_set = FALSE; if( $USE_COOKIES && isset($_COOKIE['tgp_rotator']) ) { if( strstr(",{$_COOKIE['tgp_rotator']},", ",{$_GET['ID']},") ) { $cookie_set = TRUE; } else { $value = "{$_COOKIE['tgp_rotator']},{$_GET['ID']}"; } } if( !$USE_IPLOG ) { $_SERVER['REMOTE_ADDR'] = ''; } if( !$cookie_set ) { $fd = fopen("$DDIR/clicklog", 'a'); flock($fd, LOCK_EX); fwrite($fd, "{$_GET['ID']}|{$_SERVER['REMOTE_ADDR']}\n"); flock($fd, LOCK_UN); fclose($fd); if( $USE_COOKIES ) { setcookie('tgp_rotator', $value, time() + $EXPIRE, '/'); } } } header("Location: $TEMPLATE"); ?>