PHP Classes

Can't save image

Recommend this page to a friend!

      HN CAPTCHA  >  All threads  >  Can't save image  >  (Un) Subscribe thread alerts  
Subject:Can't save image
Summary:error: unable to save captcha image
Messages:5
Author:Rasmus Kjær
Date:2007-10-19 14:53:00
Update:2007-10-20 10:40:53
 

  1. Can't save image   Reply   Report abuse  
Picture of Rasmus Kjær Rasmus Kjær - 2007-10-19 14:53:00
I have downloaded the files and the fonts. Have placed the fonts in a folder called "fonts" and have made another folder called "_tmp" both folders in the root folder. When I try the examples I get the message "Unable to save captcha-image." What can be wrong?

Sorry to be asking dumb questions, but I'm fairly newbie still...
Hope someone can point me in the right direction, 'cause trouble shooting is my weak spot in this new and wonderful world of PHP

Cheers Rasmus

  2. Re: Can't save image   Reply   Report abuse  
Picture of Horst Nogajski Horst Nogajski - 2007-10-19 17:31:49 - In reply to message 1 from Rasmus Kjær
Hi,

have you run it in Debug-Mode? If not please do so, and look what is written to the third line of debug-output:
-Captcha-Debug: tempfolder is: (???)

If the foldername is correct (casesensitive!? OS = win/unix/mac ?), check if php has writepermission for this folder.

  3. Re: Can't save image   Reply   Report abuse  
Picture of Rasmus Kjær Rasmus Kjær - 2007-10-20 09:09:26 - In reply to message 2 from Horst Nogajski
Thank you for the quick reply.

I'm running Win XP Pro, and I just found out that a lot of applications have problems writing to Win folders, as the read-only attribute can't be switched off.
I'm guessing this is why your script isn't working on my machine, though am not certain.

As I said I'm still quite a newbie and I'm not exactly sure what you meant by debug-mode. I tried to add the error_reporting(E_ALL); function at the top of the script in the hn_captcha.example.php file, but it gave no output.

By the way I have to complement your script. It's the best looking CAPTCHA I've seen on the net so far. Most others looks really bad but I'm really impressed with the output of yours.

Rasmus

  4. Re: Can't save image   Reply   Report abuse  
Picture of Horst Nogajski Horst Nogajski - 2007-10-20 10:00:21 - In reply to message 3 from Rasmus Kjær
Hi,

you can run the script with it's own debugmode turned on:
When instantiating the Class, you can pass an optional second param with TRUE, to switch on Debugging:

$captcha = new hn_captcha($CAPTCHA_INIT, TRUE); // with debugging

$captcha = new hn_captcha($CAPTCHA_INIT); // without debugging


  5. Re: Can't save image   Reply   Report abuse  
Picture of Rasmus Kjær Rasmus Kjær - 2007-10-20 10:40:53 - In reply to message 4 from Horst Nogajski
Thank you! You're debug script helped me to help myself :)
It now works. The path to the temp-folder was wrong, because I had misunderstood the script and left out the "/hn_captcha/" part.

Now I've good a job ahead - trying to figure out what the different parts of the script does and how it works, but what better way to learn :)
Thanks again

Rasmus