need help in creating captcha


Posted on 16th Feb 2014 07:03 pm by admin

hi i have a problem creating captcha system. i create some basic script for image displaying but it says this error
Code: The image “http://localhost/examples/captcha.php” cannot be displayed, because it contains errors.
my code is here

Code: <?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?

No comments posted yet

Your Answer:

Login to answer
51 Like 47 Dislike
Previous forums Next forums
Other forums

Can php detect connection speed and thereafter swap out elements?
No code to post, lads, yet. Just looking for a yay or nay at this stage:

Can a php script be

parameter passing issue on function
Well I thought I had created a pretty slick web page, using ?page and $_GET to load pages which wher

Amatuer requiring assistance
Beginner and amateur in need of assistance

My Site - (Spare Parts for Domestic Appliances)

Production of mango in processing industry
Hi,

We have one scenario ,company is in process industry,they are manufacturing MANGO pul

Issues: PHP Forms -Clearing
I've tried looking online before actually asking for help, but I've been looking for about the past

Code error with Index.php
Error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/runevid/public_

LSB (PHP 5.3) problem with static value!
hello,

i'm having a problem. static::$text variable gets lost at some point. can someone plea

button.click += new eventhandler() not works in if(!ispostback)
i want to use button.clcik event in function VIewScrap() which is called in if(!ispostback) but itdo

Is there a function ... auto send IP
Is there some function that can be sent to a ddns service that returns the ip address of a ddns forw

$action = "insert"; //$action = $_GET['action'];
$action = "insert";
//$action = $_GET['action'];

why is this invalid type? I am

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash