<?php
include('../core/core.php');
include(MAINDIR.'style/head.php');
$id = abs(intval($_GET['id']));
$lii = DB::run() -> queryFetch("SELECT * FROM `adv` WHERE `id`=? LIMIT 1",array($id));
if($lii['id'] == !NULL){
DB::run()->query("UPDATE `adv` SET `count`=`count` + ? WHERE `id`=?",array(1,$id));
header ('location: '.$lii['link'].'');
} else {header("HTTP/1.0 404 Not Found"); }
include(MAINDIR.'style/foot.php');
?>