T
Teriel9
I am trying to test my server fpr PHP function for use in a CAPTCHA and I
get this message if I open the CAPTCHA generating page
<br />
<b>Fatal error</b>: Call to undefined function: imagecreate() in
<b>c:\home\rnacarms\html\testcaptcha\captcha.php</b> on line <b>6</b><br
/>This is the code on the captcha.php page<?phpsession_start();
header("Content-type: image/png");
$image = imagecreate(60,20);
$background_color = ImageColorAllocate($image, rand(64,70), rand(70,73),
rand(100,110));
$colour1 = ImageColorAllocate($image, rand(121,255), rand(126,255),
rand(197,255));
$colour2 = ImageColorAllocate($image, rand(100,255), rand(120,255),
rand(105,255));
$colour3 = ImageColorAllocate($image, rand(131,255), rand(137,255),
rand(100,255));
imagestring($image,5,8,2,$_SESSION["captcha"],$colour1);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour2);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour3);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour1);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour2);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour3);
imageline($image, 10, 0, 14, 10, $colour1);
imageline($image, 20, 0, 24, 30, $colour2);
imageline($image, 55, 0, 34, 60, $colour3);
imagepng($image);
imagedestroy($image);
?>
Can anyone please explain the problem.
It can be seen online at
http://www.rna-carmarthen.org.uk/testcaptcha/start.html
http://www.rna-carmarthen.org.uk/testcaptcha/captcha.php
Thanks in advance
Teriel9
get this message if I open the CAPTCHA generating page
<br />
<b>Fatal error</b>: Call to undefined function: imagecreate() in
<b>c:\home\rnacarms\html\testcaptcha\captcha.php</b> on line <b>6</b><br
/>This is the code on the captcha.php page<?phpsession_start();
header("Content-type: image/png");
$image = imagecreate(60,20);
$background_color = ImageColorAllocate($image, rand(64,70), rand(70,73),
rand(100,110));
$colour1 = ImageColorAllocate($image, rand(121,255), rand(126,255),
rand(197,255));
$colour2 = ImageColorAllocate($image, rand(100,255), rand(120,255),
rand(105,255));
$colour3 = ImageColorAllocate($image, rand(131,255), rand(137,255),
rand(100,255));
imagestring($image,5,8,2,$_SESSION["captcha"],$colour1);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour2);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour3);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour1);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour2);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour3);
imageline($image, 10, 0, 14, 10, $colour1);
imageline($image, 20, 0, 24, 30, $colour2);
imageline($image, 55, 0, 34, 60, $colour3);
imagepng($image);
imagedestroy($image);
?>
Can anyone please explain the problem.
It can be seen online at
http://www.rna-carmarthen.org.uk/testcaptcha/start.html
http://www.rna-carmarthen.org.uk/testcaptcha/captcha.php
Thanks in advance
Teriel9