Güvenlik kodu uygulaması örnek ektedir..
<?php
function olustur () {
$fontnum=6;
$text = strtoupper(substr(rand(0,999999999999),-3));
session_start();
$_SESSION["guv"] = $text;
$im = imagecreatetruecolor(125, 75);
$white = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im, 0, 0, 400, 200, $white);
for ($i=0;$i<strlen($text);$i++)
{
$font = rand(1,$fontnum).".TTF";
if ((rand(2,6)%2)) { $angel=rand(0, 30); } else { $angel=rand(330, 360); }
imagettftext($im, 25, $angel, 10+$i*35, 49, imagecolorallocate($im, rand(1,250), rand(1,250), rand(1,250)), $font,$text[$i]);
}
$x=100; $y=100; $size=200;
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
}
olustur();
?>Kullanımı;
<img src="imgcode.php">