<?php
defined('PROTECTOR') OR die('Нет доступа');
session_start();
$db_host = "localhost";
$db_user = "idmao128_vturage";
$db_table = "idmao128_vturage";
$db_pass = "game777g";
$connect = mysql_pconnect($db_host, $db_user, $db_pass) OR die('Нет подключения!');
mysql_select_db($db_table) OR die('Нет подключения!');
mysql_query("SET NAMES 'utf8'", $connect);
include('sql.php');
$stop_injection = new InitVars();
$stop_injection->checkVars();
foreach($_GET as $ad){
  if(is_numeric($ad)){
$ad = abs(intval($ad));
}
 if(preg_match('/\include|asc|--|select|union|update|from|where|eval|glob|include|require|script|shell|BENCHMARK|CONCAT|INSERT\b/i', $ad)){

$source = 'USER: '.$_SERVER['REMOTE_ADDR'].' | FILE: '.htmlspecialchars($_SERVER["REQUEST_URI"]).'
';
$file = htmlspecialchars($_SERVER['DOCUMENT_ROOT']).'../files/log_guard.txt';
$Saved_File = fopen($file, 'a+');
fwrite($Saved_File, $source);
fclose($Saved_File);

header("Refresh: 2;url=/".SID);
 exit('Защита !');
 }

 $ad = htmlspecialchars(mysql_real_escape_string($ad));

 }
 foreach($_POST as $ad){
  if(is_numeric($ad)){
$ad = abs(intval($ad));
}else{
 $ad = htmlspecialchars(mysql_real_escape_string($ad));
 }
}
 foreach($_SESSION as $ad){
 $ad = htmlspecialchars(mysql_real_escape_string($ad));
 }
 foreach($_COOKIE as $ad){
 $ad = htmlspecialchars(mysql_real_escape_string($ad));
 }
 $id = isset($_GET['id'])?abs(intval($_GET['id'])):NULL;
?>