Просмотр файла referers/core.php

Размер файла: 580B
<?php

include './db.php';
session_start();

if(!empty($_SERVER['HTTP_REFERER']) && parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) != $site && @$_SESSION['referer'] != htmlspecialchars(trim($_SERVER['HTTP_REFERER']))) {

$_SESSION['referer'] = htmlspecialchars(trim($_SERVER['HTTP_REFERER']));

mysql_query("INSERT INTO `referers` SET
`ip` = '". $_SERVER['REMOTE_ADDR'] ."',
`ua` = '". mysql_real_escape_string(trim($_SERVER['HTTP_USER_AGENT'])) ."',
`url` = '". mysql_real_escape_string(trim($_SERVER['HTTP_REFERER'])) ."',
`time` = UNIX_TIMESTAMP()");

}

?>