Размер файла: 1.53Kb
<?php
Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
extract($HTTP_COOKIE_VARS);
extract($HTTP_SERVER_VARS);
session_name("SESID");
session_start();
$id=str_replace('../','',$id);
include"config.php";
$base="./data/users/perehod/$id.$raz";
$time = date("H:i", time());
$date = date("dmy", time());
$adate = date("d.m.y", time());
$ip = getenv("REMOTE_ADDR");
$ref=getenv("HTTP_REFERER");
$user_agent=getenv("HTTP_USER_AGENT");
$nip=getenv("HTTP_X_FORWARDED_FOR");
$brauzer = strtok($user_agent," ");
$ref=str_replace('http://','',$ref);
$ref=strtok($ref,"/");
$brauzer = htmlspecialchars($brauzer);
$brauzer = str_replace('|', '', $brauzer);
$gdata=file("data/users/profil/$id.$raz");
$ssp=explode("|",$gdata[0]);
$aurl=$ssp[2];
if(!empty($ref)){
if($ref!=$aurl){
$err="1";
$uerr="1"; }}
include"./part_ip.php";
if(empty($brauzer)){
$err="1"; }
if(strlen($ip) > 15){
$err="1";
}
if(strlen($ip) < 7){
$err="1";
}
if($err!=1){
$counter_array = file("data/users/vsego.$raz");
$lid = $counter_array[0]+1;
$fp = @fopen("data/users/vsego.$raz","wb");
@fputs($fp,$lid);
@fclose($fp);
$back = @file_get_contents("$base");
$file = fopen("$base","w");
flock ($file,LOCK_EX);
fputs($file,"$brauzer|$ip|$time|$date|$adate|$ref|$nip"."\r\n"."$back");
fflush ($file);
flock ($file,LOCK_UN);
fclose($file);
header ("Location: http://$gosite"); }else{
if($uerr=="1"){
header ("Location: $goerror2"); }else{
header ("Location: $goerror1"); }
}
?>