Просмотр файла images/protect.php

Размер файла: 1.83Kb
<?php
// taken from rotorcms & changed smth, don't be evil, please =)
// made by Vantuz

require("../config.php");
require("../includes/start.php");

if (isset($_SESSION['protect']) && $_SESSION['protect'] != "") {
    $pkod = str_split(intval($_SESSION['protect']));

    $img = imagecreate(50, 22);
    $bgcolor = imagecolorallocate($img, 255, 255, 255);
    $fon = imageColorTransparent($img, $bgcolor);
    imagefill($img, 0, 0, $fon);

    $color1 = imagecolorallocate($img, mt_rand(0, 204), mt_rand(0, 204), mt_rand(0, 204));
    $color2 = imagecolorallocate($img, mt_rand(0, 204), mt_rand(0, 204), mt_rand(0, 204));
    $color3 = imagecolorallocate($img, mt_rand(0, 204), mt_rand(0, 204), mt_rand(0, 204));
    $color4 = imagecolorallocate($img, mt_rand(0, 204), mt_rand(0, 204), mt_rand(0, 204));

    imageTTFtext($img, 16, 0, mt_rand(1, 2), mt_rand(17, 20), $color1, "../images/fonts/font2.ttf", $pkod[0]);
    imageTTFtext($img, 16, 0, mt_rand(13, 14), mt_rand(17, 20), $color2, "../images/fonts/font2.ttf", $pkod[1]);
    imageTTFtext($img, 16, 0, mt_rand(25, 26), mt_rand(17, 20), $color3, "../images/fonts/font2.ttf", $pkod[2]);
    imageTTFtext($img, 16, 0, mt_rand(37, 38), mt_rand(17, 20), $color4, "../images/fonts/font2.ttf", $pkod[3]);

       for ($i = 0; $i < 5; $i++) {
           $temp_color = imagecolorallocate ($img, mt_rand(155, 204), mt_rand(155, 204), mt_rand(155, 204));
           imageline($img, mt_rand(0, 50), mt_rand(0, 22), mt_rand(0, 50), mt_rand(0, 22), $temp_color);
       } 

       for ($i = 0; $i < 30; $i++) {
           $temp_color = imagecolorallocate ($img, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
           imagesetpixel ($img, mt_rand(0, 50), mt_rand(0, 22), $temp_color);
       } 

    Header("Content-type: image/gif");
    ImageGIF($img);
    ImageDestroy($img);
} 

?>