Файл: backup_fzrf 2/antibot/sec_code.php
Строк: 21
<?php
/*==============================================
Appointment: Выводим текущую каптчу для AJAX
File: sec_code.php
Author: Sergei Pavlenko
Engine: People Engine Cms
Copyright: People Design Group (с) 2014
e-mail: info@vxas.ru
URL: http://www.vxas.ru/
Данный код защищен авторскими правами
===============================================*/
@session_start();
@error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
function clean_url($url){
if ($url == '') return;
$url = str_replace("http://", "", strtolower($url));
$url = str_replace("https://", "", $url );
if (substr($url, 0, 4) == 'www.') $url = substr($url, 4);
$url = explode('/', $url);
$url = reset($url);
$url = explode(':', $url);
$url = reset($url);
return $url;
}
if(clean_url($_SERVER['HTTP_REFERER']) != clean_url($_SERVER['HTTP_HOST']))
die("Hacking attempt!");
$user_code = $_GET['user_code'];
if($user_code == $_SESSION['sec_code']){
echo 'ok';
} else {
echo 'no';
}
?>