Вход Регистрация
Файл: captcha.php
Строк: 54
<?php
include_once 'sys/inc/start.php';
include_once 
'sys/inc/sess.php';
include_once 
'sys/inc/home.php';
include_once 
'sys/inc/settings.php';
include_once 
'sys/inc/db_connect.php';
include_once 
'sys/inc/ipua.php';
include_once 
'sys/inc/fnc.php';
$show_all=true;
include_once 
'sys/inc/user.php';

$_SESSION['captcha']='';

$first mt_rand(11,55);
$second mt_rand(1,9);
$_SESSION['captcha'] = ($first $second);

$code "$first + $second=";
$width 80;
$height 30;
$sign strlen($code);


$figures = array( '50','70','90','110',
                 
'130','150','170','190','210' );

$img imagecreatetruecolor($width$height);

$fon imagecolorallocate($img255255255);
imagefill($img00$fon);

for(
$i=0$i<$sign$i++)
    {
        
$h 1;
        
$color imagecolorallocatealpha(
                    
$img,
                    
$figures[rand(0count($figures)-1)],
                    
$figures[rand(0count($figures)-1)],
                    
$figures[rand(0count($figures)-1)],
                    
rand1030 ) );

        
$letter $code[$i];

        if( empty( 
$x ) ) $x $width*0.08;
            else 
$x $x + ( $width*0.8 )/$sign+rand0,$width*0.01 );

        if( 
$h == rand1) ) $y = ( ( $height*)/) + rand0$height*0.1 );
            else 
$y = ( ( $height*)/) - rand0$height*0.1 );

        
$code.= $letter;
        
imagestring$img,$x$y$letter$color );
    }

header "Content-type: image/jpeg" );
imagejpeg$img );

?>
Онлайн: 2
Реклама