簡単なキャプチャ ジェネレータを作成しましたが、 captcha-image は表示されません。
index.php :
<?php
session_start();
$_SESSION['captcha'] = rand(1000, 9999);
?>
<img src="generator.inc.php" />
generator.inc.php :
<?php
session_start();
header('Content-type: image/jpeg');
$text = $_SESSION['captcha'];
$font_size = 30;
$image_width = 160;
$image_height = 50;
$image = imagecreate($image_width, $image_height);
imagecolorallocate($image, 200, 200, 200);
$font_color = imagecolorallocate($image, 20 , 20 , 20);
imagettftext($image, $font_size, 0, 15, 30, $font_color, 'BYekan.ttf', $text);
imagejpeg($image);
?>
私が間違っていることを教えてください。
PS :
Linux で Lamp サーバーを使用しています。