Файл: in.php
Строк: 23
<?php
define('MTOP', 1);
require_once('system/connect.php');
require_once('system/core.php');
require_once('system/function.php');
if(!$id OR $id < 1){
header('Location: /?yamus');
exit;
}
$isset = mysql_query("SELECT * FROM `sait` WHERE `status` != '0' AND `id` = '".$id."'");
if(mysql_num_rows($isset) == 0){
header('Location: /?yamus');
exit;
}
$page = ceil(mysql_result(mysql_query("SELECT COUNT(*) FROM `sait` WHERE `status` = '1' AND `hosts` > '0' AND `id` = '".$id."'"), 0) / $page_top);
$sait = mysql_fetch_array($isset);
$nakrut = mysql_query("SELECT * FROM `in` WHERE `id_sait` = '".$id."' AND `ip` = '".$ip."'");
if (mysql_num_rows($nakrut) == 0){
mysql_query("INSERT INTO `in` (`id_sait`,`ip`) values('".$id."','".$ip."')");
mysql_query("UPDATE `sait` SET `in` = (`in` + 1), `all_in` = (`all_in` + 1) WHERE `id` = '".$id."'");
}
header('Location: /index.php?page='.$page.'&yamus');
?>