This is supposed to randomly choose 3 letters, and place them in an image. All it does right now is choose a random background color, which is not what I want. The background is supposed to be white, anyways. Any idea why this doesn't work? Thanks.
Code:
<?
$picture = imagecreate(200,200);
$lets = "abcdefghijklmnopqrstuvwxyz123456789";
$string = $lets{rand(0,34)} . $lets{rand(0,34)} . $lets{rand(0,34)};
$font_size = 20;
$font_color = imagecolorallocate($picture, rand(60,100), rand(60,100), rand(60,100));
$background_color = imagecolorallocate ($picture, 255, 255, 255);
$x = rand(40,80);
$y = rand(40,80);
$rotation = rand(-45, 45);
$file = "1.TTF";
imagettftext ($picture, $font_size, $rotation, $x, $y, $font_color, $file, $string);
header ("Content-type: image/png");
imagepng ($picture);
?>