Jump to content

need help in creating captcha


doforumda

Recommended Posts

hi i have a problem creating captcha system. i create some basic script for image displaying but it says this error

The image “http://localhost/examples/captcha.php” cannot be displayed, because it contains errors.

 

my code is here

 

<?php
$img = imagecreatetruecolor(80,30);

$white = imagecolorallocate($img, 255, 255, 255);
$black = imagecolorallocate($img, 0, 0, 0);
$red = imagecolorallocate($img, 255, 0, 0);
$pink = imagecolorallocate($img, 200, 0, 150);

imagefill($img, 0, 0, $black);

imagettftext($img, 12, 0, 15, 15, "calibri.ttf", "hello"); 

header("Content-type: image/png");
imagepng($img);
imagedestroy($img);
?>

 

where is the error and how it can be fixed?

Link to comment
https://forums.phpfreaks.com/topic/181114-need-help-in-creating-captcha/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.