我制作了这段代码,它应该向我展示一个带有文本的图像,但该图像不会出现。任何的想法?
<?php
header("Content-type: image/png");
$md5 = md5(microtime() * mktime());
$string = substr($md5,0,5);
$captcha = imagecreatefrompng('bg.png');
$black = imagecolorallocate($captcha, 0, 0, 0);
$line = imagecolorallocate($captcha,233,239,239);
imageline($captcha,0,0,39,29,$line);
imageline($captcha,40,0,64,29,$line);
imagestring($captcha, 5, 20, 10, $string, $black);
$_SESSION['key'] = md5($string);
imagepng($captcha);
imagedestroy($captcha);
?>