View file template/referer.php

File size: 1.31Kb
<?php
#-----------------------------------------------------#
#          ********* WAP-MOTORS *********             #
#             Made by   :  VANTUZ                     #
#               E-mail  :  [email protected]         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#
if (!defined("BASEDIR")) { header("Location:../index.php"); exit; }

if ($http_referer!=""){
if (ereg ("^http",$http_referer)){
$http_referer=check_string($http_referer);
if (eregi("^[a-z0-9\.-]+\.[a-z]{2,4}\$", $http_referer)){
if ($http_referer!=$config_servername){

$textref=$http_referer.'|'.$sitetime.'|'.$ip.'|';	  
$fp = fopen(BASEDIR."local/referer.dat","a+"); 
flock ($fp,LOCK_EX);
fputs($fp,"$textref\r\n");
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);

$reffile=file(BASEDIR."local/referer.dat"); 
$refcount = count($reffile);
if ($refcount>=$config_referer) {
$fp=fopen(BASEDIR."local/referer.dat","w");
flock ($fp,LOCK_EX);
unset($reffile[0],$reffile[1]);
fputs($fp, implode($reffile));
flock ($fp,LOCK_UN);
fclose($fp);}	

}}}}
?>