Not Found

The requested URL was not found on this server.

\n"; exit; } $type = $_GET['type']; $bannerid = $_GET['bannerid']; $bid = $_GET['bid']; $local = $_GET['local']; $regionid = $_GET['regionid']; // get link switch ($type) { case 'newtile': $query = "SELECT link FROM banners_tile_new WHERE bannerID='$bannerid'"; break; case 'wide': $query = "SELECT link FROM banners_wide"; if (!$local) $query .= "_nationalpool"; $query .= " WHERE bannerID='$bannerid'"; break; /* default: echo "I'm sorry. This page has been incorrectly accessed."; exit; */ } $result = @mysql_query($query); list($link) = @mysql_fetch_row($result); if (!$link) { // don't try to redirect unless we have a $link //echo "I'm sorry. This page has been incorrectly accessed."; header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found", true, 404); echo " 404 Not Found

Not Found

The requested URL was not found on this server.

\n"; exit; } // check for bots $human = TRUE; include('/var/www/html/botlist.php'); $useragent = $_SERVER['HTTP_USER_AGENT']; foreach ($bots as $bot) { if (stristr($useragent, $bot) !== FALSE) $human = FALSE; } if (!$useragent) $human = FALSE; // empty string if ($human) { // how many links already today? $query = "SELECT num FROM bannertrack_clicks WHERE bid='$bid' AND type='$type"; if ($local) $query .= "_local"; else $query .= "_national"; $query .= "' AND id='$bannerid' AND regionid='$regionid' AND linkdate=CURDATE()"; $result = mysql_query($query); list($num) = mysql_fetch_row($result); $num++; // record the link if (mysql_num_rows($result) > 0) { $query = "UPDATE bannertrack_clicks SET num='$num' WHERE bid='$bid' AND type='$type"; if ($local) $query .= "_local"; else $query .= "_national"; $query .= "' AND id='$bannerid' AND regionid='$regionid' AND linkdate=CURDATE()"; } else { $query = "INSERT INTO bannertrack_clicks SET bid='$bid', type='$type"; if ($local) $query .= "_local"; else $query .= "_national"; $query .= "', id='$bannerid', regionid='$regionid', linkdate=CURDATE(), num=1"; } $result = mysql_query($query); } // redirect header('HTTP/1.1 301 Moved Permanently'); header("Location: $link"); exit; ?>