<?
$pik = array('1','2','3','4','5','6','7','8','9','0');
$code = $pik[rand(0, 10)].$pik[rand(0, 10)].$pik[rand(0, 10)].$pik[rand(0, 10)].$pik[rand(0, 10)];
$code = htmlspecialchars($code);
$img = "fone.jpg";
$pic = imageCreateFromjpeg($img);
$size = 14;
$angle = rand (-3, 3);
$x = rand(3,6);
$y = rand(17,25);
$color = rand(1000,9999999);
$fontfile = "font.otf";
ImageTTFtext($pic, $size, $angle , $x, $y, $color, $fontfile, $code);
header("Content-type:image/jpeg");
imagejpeg($pic);
imagedestroy($pic);
fwrite(fopen('./codes/'.intval($_GET['rnd']).'.txt', 'w'), $code);
?>