امتحان کردم به جای time،mktime قرار دادم بازم درست نشد اینم از کد
$md=md5(microtime() * time());
$string=substr($md,0,5);
$capcha=imagecreatefrompng("./capcha.png");
$blank=imagecolorallocate($capcha,0,0,0);
$line=imagecolorallocate($capcha,233,239,239);
imageline($capcha,0,0,39,29,$line);
imageline($capcha,40,0,64,29,$line);
imagestring($capcha,10,20,10,$string,$blank);
header("Content-type:image/png");
imagepng($capcha);
header رو برداشتم این ارور رو داد اینگار همه کد ها مشکل داشت
Warning: imagecreatefrompng(./capcha.png): failed to open stream: No such file or directory in C:\xampp\htdocs\capcha\capcha.php on line 4
Warning: imagecolorallocate() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\capcha\capcha.php on line 5
Warning: imagecolorallocate() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\capcha\capcha.php on line 6
Warning: imageline() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\capcha\capcha.php on line 7
Warning: imageline() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\capcha\capcha.php on line 8
Warning: imagestring() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\capcha\capcha.php on line 9
Warning: imagepng() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\capcha\capcha.php on line 11