Alıntı
<?php
session_start();
header("Content-type: image/png");
function generateCode($characters) {
$possible = '23456789abcdfghjkmlnpqrstvwxyz';
$code = '';
$i = 0;
while ($i < $characters) {
$code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);
$i++;
}
return $code;
}
$yazi = generateCode("10");
$hash = substr (md5 ($yazi),5,6);
$en = strlen($hash)*15;
$boy = 30;
$resim = ImageCreate($en, $boy);
$siyah = ImageColorAllocate($resim, 0, 0, 0);
$beyaz = imageColorAllocate($resim, 255, 255, 255);
imagefilledrectangle($resim, 0, 0, $en, $boy, $siyah);
ImageString($resim, 5, 16 , 7 , $hash , $beyaz);
ImagePNG($resim);
$_SESSION['security_code'] = $hash;
?>
istediğiniz sanırım bu arkadaşlar..