I want to program a class for captcha code in php,I can do it by GD,but it seem that is not available in all server,is there any way to do it? is there any library,that available in all servers?and supported by all of them?
-
1There's no library guaranteed to be available on all servers, but GD is about your best bet. That, or manually setting all the bits of an image, which is possible, but not something you normally want. You could of course use a third party option like recaptchaWrikken– Wrikken2011-07-20 16:27:23 +00:00Commented Jul 20, 2011 at 16:27
4 Answers
GD is available on all servers, it's just a matter of having the PHP extensions loaded. Since PHP does not have image processing natively built in to the language, an extension is the best anyone can hope for.
It's worth noting that ImageMagick is another option, but it's a bit of a pain to get installed.
Comments
GD might actually not be installed on some web servers which is reason enough to first check which image manipulation extensions are available with http://php.net/manual/en/function.get-loaded-extensions.php
Comments
If you want something that must work without gd, you could take a look at NUCaptcha. The only PHP prerequisite is the mcrypt library. As opposed to a traditional CAPTCHA, the NUCaptcha website explains:
NuCaptcha is displayed as an H.264 MPEG-4 Video Stream that is rendered in your browser in a variety of ways.