Na mojej
Kniha návštev používam pre captcha - u tento kód.

Pre správnosť fungovania obnovenia hesla odporúčam urobiť refresh tejto stránky.
Kód:
<?php
// Copyraid je cez uja google.
// Adapted for The Art of Web: www.the-art-of-web.com
// Please acknowledge use of this code by including this header.
// http://www.the-art-of-web.com/php/captcha/
// initialise image with dimensions of 110 x 27 pixels
$image = imagecreatetruecolor(110, 27) or die("Cannot Initialize new GD image stream");
// set background to white and allocate drawing colours
$background = imagecolorallocate($image, 0x22, 0x22, 0xFF);
imagefill($image, 0, 0, $background);
$linecolor = imagecolorallocate($image, 0x6B, 0xA1, 0x6B);
$line_line = imagecolorallocate($image, 0x33, 0x33, 0x33);
$textcolor = imagecolorallocate($image, 0xFF, 0xC8, 0x22);
// Set the line thickness to 3
imagesetthickness($image, 3);
imagerectangle($image, 0, 0, 110, 27, $line_line);
// draw random lines on canvas
for($i=0; $i < 6; $i++) {
imagesetthickness($image, rand(1,1));
imageline($image, 0, rand(0,30), 120, rand(0,30), $linecolor);
}
session_start();
$font = './arial.ttf';
$font_size = '20';
// add random digits to canvas
$text = '';
$letter = array_merge(range('0', '9'), range('A', 'Z'), range('a', 'z'));
for($i=0; $i < 5; $i++) {
$text .= $letter[mt_rand(0, count($letter) - 1)];
}
imagettftext($image, $font_size, 0, 10, 21, $textcolor, $font, $text);
// record digits in session variable
// http://php.net/manual/en/function.imagettftext.php
$_SESSION['cislo_Fzmo7'] = $text;
// display image and clean up
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>