ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Securing Web Forms with PEAR's Text_CAPTCHA
Subject:   Problem with CAPTCHA code.
Date:   2007-04-09 03:37:03
From:   DNagesh
Hello Support Team,
I have followed all the steps to implement the CAPTCHA. Below is part of the code:
$captcha->init(150,150);
$image_data = $captcha->getCAPTCHAAsJPEG();
$handle = fopen('captcha.jpg', 'a');
The problem is that it is not showing the phrase on the image. I think the problem is with fwrite($handle, $image_data); This line should write the phrase onto the original jpg image. But it is not writting. Please tell me the solution. The user will be entering the phrase but it should be shown on the image and that is what it is not showing.


I think it is due to method getCAPTCHAAsPNG return and object and fwrite needs a string. Please reply as soon as possible.


Thankyou all.