Просмотр файла pages/captcha.php

Размер файла: 2.19Kb
<?php
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
// Sitchi CMS - Mobile Content Management System //
// The author:  Nikoloz Sitchinava [sitchi]      //
// Link:        http://sitchicms.num.ge          //
// Skype:       SitchiCMS                        //
// License:     LICENSE.txt (see attached file)  //
// Version:     VERSION.txt (see attached file)  //
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
define('_SITCHICMS', 1);
$root_path='../';
require $root_path.'includes/db_connect.php';
require $root_path.'includes/start.php';
require $root_path.'includes/header.php';
require $root_path.'includes/functions.php';
require $root_path.'includes/head.php'; // თავი
$pkod = str_split(intval($_SESSION['rand']));
$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, $root_path . "images/fonts/font2.ttf", $pkod[0]);
imageTTFtext($img, 16, 0, mt_rand(13, 14), mt_rand(17, 20), $color2, $root_path . "images/fonts/font2.ttf", $pkod[1]);
imageTTFtext($img, 16, 0, mt_rand(25, 26), mt_rand(17, 20), $color3, $root_path . "images/fonts/font2.ttf", $pkod[2]);
imageTTFtext($img, 16, 0, mt_rand(37, 38), mt_rand(17, 20), $color4, $root_path . "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);
?>