<?php
require_once 'sys/db.php';
require_once 'sys/func.php';
$id = abs(intval($_GET['id']));
$sitess = $db->query("select * from `rekl` where `id` = '".$id."'");
$co_s = $sitess->num_rows;
$row = $sitess->fetch_assoc();
if ($co_s == 0) {
echo '
<div class="alert alert-danger" role="alert">
Сайта не существует!</div>
';
} else {
$db->query("insert into `site_klik` set `id_site` = '".$id."'");
header ('Location: '.$row['url'].'');
exit;
}
?>