|
掲示板で画像に5桁の数字を表示させて、それに一致しないと投稿不可みたいなやつ <?php
$image = ImageCreate(50, 20);
$background_color = ImageColorAllocate($image, 0, 0, 0);
$text_color = ImageColorAllocate($image, 255, 255, 255);
$text = rand(10000, 99999);
// image, font-size, angle, x, y, coloe, font-file, text
ImageTTFText($image, 10, 0, 5, 15, $text_color, "/usr/share/fonts/bitstream-vera/Vera.ttf", $text);
$time = time();
$image_path = "./auth/{$time}.gif";
ImageGif ($image, $image_path);
ImageDestroy($image);
chmod($image_path, 0666);
$text_path = "./auth/{$time}.txt";
file_put_contents($text_path, $text);
chmod($text_path, 0666);
?>
|