Вход Регистрация
Файл: wenr.online/app/captcha.php
Строк: 27
<?php

$width 
120;
$height 60;

$font_size 14;
$font_file 'assets/fonts/captcha.otf';

$length mt_rand(35);

$string '123456789abcdefghijklmnpqrstuvwxyz';

$image imagecreatetruecolor($width$height);

imagesavealpha($imagetrue);
imagefill($image00imagecolorallocatealpha($image000127));

$text null;
for (
$i 0$i $length$i++) {
    
$color imagecolorallocatealpha($imagemt_rand(0100), mt_rand(0100), mt_rand(0100), mt_rand(2040));

    
$text .= substr(str_shuffle($string), 01);

    
$size mt_rand($font_size 2$font_size 2);

    
$x = ($width 20) / $length $i 10;
    
$x mt_rand($x$x 5);

    
$y = ($height 3) + mt_rand(05);

    
imagettftext($image$sizemt_rand(-1010), $x$y$color$font_file$text[$i]);
}

header('Content-Type: image/png');

imagepng($image);
imagedestroy($image);

$_SESSION['captcha'] = $text;
Онлайн: 0
Реклама