<?php ini_set('error_reporting', E_ALL); ini_set('display_errors', 0); ini_set('display_startup_errors', 0); define("FastCore", true); define('BASE_DIR', $_SERVER['DOCUMENT_ROOT']); $action = filter_var($_GET['action'],FILTER_SANITIZE_STRING); $arr = ['surf' => 'surf', 'surfv' => 'surfv', 'links' => 'links','surfban' => 'surfban']; $ajax = $arr[$action]; if($ajax != NULL) { if (strpos($action, ".") !== false) { echo "Unknown request"; } else { if(file_exists(BASE_DIR.'/ajax/'.$ajax.'.php')) { session_start(); if(!empty($_SESSION['uid'])){ # Система spl_autoload_register(function ($name) { require (BASE_DIR.'/core/'.$name.'.php'); }); $config = new config; $func = new func; } include(BASE_DIR.'/ajax/'.$ajax.'.php'); } else { echo 'Unknown request'; } } } else { echo 'Unknown request'; }