View file num.php

File size: 2.08Kb
<?php
header("Cache-Control: no-cache, must-revalnumate");
header("Pragma: no-cache");
include("config.php");
$hz1=rand(1,9);
$hz2=rand(0,9);
$hz3=rand(0,9);
$hz4=rand(0,9);
$hz5=rand(0,9);
$hz="$hz1$hz2$hz3$hz4$hz5";

$img = ImageCreate(65,15);
$fon = imagecolorallocate($img, 0,0,0);
$lime = imagecolorallocate($img, 50,250,50);

imageFill($img,65,15,$fon);

imagettftext($img, 8, 1, 5 ,10, $lime,'./font.ttf',"$hz1");
imagettftext($img, 8, 1, 17 ,12, $lime,'./font.ttf',"$hz2");
imagettftext($img, 8, 1, 30 ,10, $lime,'./font.ttf',"$hz3");
imagettftext($img, 8, 1, 42 ,12, $lime,'./font.ttf',"$hz4");
imagettftext($img, 8, 1, 53 ,10, $lime,'./font.ttf',"$hz5");

function check_ua($str){
$str = str_replace("\\n", " ", $str);
$str = str_replace("$", "$$", $str);
$str = str_replace("}", "a", $str);
$str = str_replace("?", "a", $str);
$str = str_replace(",", ".", $str);
$str = str_replace("sql", "a", $str);
$str=strtr($str,array(chr("0")=>"",chr("1")=>"",chr("2")=>"",chr("3")=>"",chr("4")=>"",chr("5")=>"",chr("6")=>"",chr("7")=>"",chr("8")=>"",chr("9")=>"",chr("10")=>"",chr("11")=>"",chr("12")=>"",chr("13")=>"",chr("14")=>"",chr("15")=>"",chr("16")=>"",chr("17")=>"",chr("18")=>"",chr("19")=>"",chr("20")=>"",chr("21")=>"",chr("22")=>"",chr("23")=>"",chr("24")=>"",chr("25")=>"",chr("26")=>"",chr("27")=>"",chr("28")=>"",chr("29")=>"",chr("30")=>"",chr("31")=>""));
$str = htmlspecialchars($str);
$str=addslashes($str);
return $str;}  // Фильтрация переменных
$ua=check_ua($HTTP_USER_AGENT);
$ip=$REMOTE_ADDR;
$time=time();
$time_off=time()+300;
@mysql_query("DELETE FROM `cat_code` WHERE `time`<'$time';");
@mysql_query("DELETE FROM `cat_code` WHERE `ip`='$ip' AND `ua`='$ua';");
@mysql_query("INSERT INTO `cat_code` VALUES ('$hz','$ip','$ua','$time_off')");
@mysql_close($mysql);
Header("Content-type: image/png");
ImagePNG($img);
ImageDestroy($img);
/*
чойнбойе!!! ултйрф тбътеыеооп тбуртпуфтбосфш фпмшлп бчфптх (GuT'y) ултйрфб !!!
ретертпдбчбфш! дбчбфш лпнх фп об тедблфйтпчбойе! ртпуфп дбчбфш лбл дтхзх ймй чщлмбдщчбфш об ибмсчх - ъбретеэеоп !!!
йобюе вхдхф ртпвменщ :-)))
*/
?>