Вход Регистрация
Файл: captcha.php
Строк: 55
<?php
////////////////////////////////////////
//                                    //
//          Core for site             //
//         Ядро для сайта             //
//          Author: UndeX             //
//          Автор: UndeX              //
//       Contacts/Контакты:           //
//  Mail: undex.project@gmail.com     //
//  ICQ: 676768169                    //
//                                    //
////////////////////////////////////////

////////////////////////////////////////
//                                    //
//           For FREE use             //
//   Для бесплатного использования    //
//                                    //
////////////////////////////////////////

require_once('system/config.php');
error_reporting(0);
$width = $sys['captcha_width'];
$height = $sys['captcha_heigth'];
$sign = $sys['captcha_sign'];
$img_code = '';

session_start();

$letters = $sys['captcha_letters'];
$digital_data = $sys["captcha_rgb"];

$img = imagecreatetruecolor($width, $height);
$fon = imagecolorallocate($img, 255, 255, 255);
imagefill($img, 0, 0, $fon);
$letter_Width = intval((0.9*$width)/$sign); 
for(
$j=0; $j<$width; $j++) {
   for(
$i=0; $i<($height*$width)/600; $i++) {
     
$color = imagecolorallocatealpha($img,
              
$digital_data[rand(0,count($digital_data)-1)],
              
$digital_data[rand(0,count($digital_data)-1)],
              
$digital_data[rand(0,count($digital_data)-1)],
              
rand(10,30));
     
imagesetpixel($img, rand(0,$width), rand(0,$height), $color);
   }
}

for(
$i=0; $i<$sign; $i++) {
            
$color = imagecolorallocatealpha($img,
            
$digital_data[rand(0,count($digital_data)-1)],
            
$digital_data[rand(0,count($digital_data)-1)],
            
$digital_data[rand(0,count($digital_data)-1)],
            
rand(10,30));
   
$letter = $letters[rand(0,sizeof($letters)-1)];
   if(empty(
$x)) { $x = intval($letter_Width*0.2); }
   else {
     if(
rand(0,1))  $x = $x + $letter_Width + rand(0, intval($letter_Width*0.1));
     else 
$x = $x + $letter_Width - rand(0, intval($letter_Width*0.1));
   }
   
$y = rand( intval($height*0.7), intval($height*0.8) );
   
$size = rand(intval(0.4*$height), intval(0.5*$height));
   
$angle = rand(0, 50) - 25;
   
$img_code .= $letter;
   
imagettftext($img, $size, $angle, $x, $y, $color, "system/fonts/".$sys['captcha_fontname'].".ttf", $letter);
}

$_SESSION["img_code"] = $img_code;
header("Content-type: image/png");
imagepng($img);
?>
Онлайн: 1
Реклама