Пример #1
0
        // 1.0 = high distortion, higher numbers = more distortion
        $img->num_lines = 6;
    }
    if (isset($_GET['no_trans']) && $_GET['no_trans'] == 1) {
        $img->use_transparent_text = false;
    }
    $img->charset = 'ABCDEFHKLMNPRSTUVWYZ234578';
    $img->ttf_file = getcwd() . '/ttffonts/ahg-bold.ttf';
    // single font
    $img->line_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
    $img->image_type = 'png';
    $img->background_directory = getcwd() . '/backgrounds';
    $img->ttf_font_directory = getcwd() . '/ttffonts';
    $img->show('');
    if (!file_exists($img->captcha_path . $prefix . '.php')) {
        $img->clean_temp_dir($img->captcha_path);
        if ($fh = fopen($img->captcha_path . $prefix . '.php', 'w')) {
            fwrite($fh, '<?php $captcha_word = \'' . $captcha_word . '\'; ?>');
            fclose($fh);
            @chmod($img->captcha_path . $prefix . '.php', 0755);
        }
    }
    unset($img);
    exit;
} else {
    // session
    include 'securimage.php';
    $img = new securimage();
    $img->code_length = 4;
    $img->image_width = 175;
    $img->image_height = 60;