Файл: like.php
Строк: 15
<?php
define('GCMS',true);
require_once ('system/power.php');
if($aut){
$wh = array('comes','files');
if (in_array($mode, $wh)) {
$count = $db -> dbcount('COUNT(`id`)',$mode,"`id` = '".$id."'");
if ($count > 0) {
$te = $db -> query("SELECT * FROM `reit` WHERE `where`='".$mode."' and `komy` = '".$id."' and `kto` = '".$sid."' LIMIT 1");
if ($te -> num_rows > 0) {
$db -> query("DELETE FROM `reit` WHERE `komy` = '".$id."' and `where` = '".$mode."' and `kto` = '".$sid."' LIMIT 1");
}else{
$db -> query("INSERT INTO `reit` SET `where`='".$mode."', `kto` = '".$sid."', `komy` = '".$id."'");
}
}
}
if(mb_strlen(shit($_SERVER['HTTP_REFERER']))>0)$go=shit($_SERVER['HTTP_REFERER']); else $go='/';
header('location: '.$go);
}else header('Location: /aut.php');
?>