Файл: captcha.php
Строк: 33
<?php
//session_start();
//session_name('sid');
$_SESSION['code'] = mt_rand(1111, 9999);
$img = ImageCreate(42, 18);
$font = ImageColorALLocate($img, 255, 255, 255);
ImageFill($img, 0, 0, $font);
ImageString($img, 5, rand(2,3), rand(0,3), substr($_SESSION['code'], 0, 1), ImageColorALLocate($img, rand(0, 204), rand(0, 204), rand(0, 204)));
ImageString($img, 5, rand(11,12), rand(0,3), substr($_SESSION['code'], 1, 1), ImageColorALLocate($img, rand(0, 204), rand(0, 204), rand(0, 204)));
ImageString($img, 5, rand(20,21), rand(0,3), substr($_SESSION['code'], 2, 1), ImageColorALLocate($img, rand(0, 204), rand(0, 204), rand(0, 204)));
ImageString($img, 5, rand(29,30), rand(0,3), substr($_SESSION['code'], 3, 1), ImageColorALLocate($img, rand(0, 204), rand(0, 204), rand(0, 204)));
header('Content-type: image/gif');
ImageGIF($img);
ImageDestroy($img);
?>