By: Trent
Date: 2007-02-08
Time: 02:38
|
CAPTCHA and TBSI'm trying to implement a simple CAPTCHA system for my logins and I'm having a few issues. When not using TBS, my CAPTCHA function works, but when I try and implement it with TBS, I get the following error:
The image “http://localhost/demo/login.php” cannot be displayed, because it contains errors. Here is my php function:
|
|||
By: sheepy
Date: 2007-02-08
Time: 05:42
|
Re: CAPTCHA and TBSFirst, the function won't work since it's trying to return a function not a variable.
Assuming that is fixed, I take it that it is returning a GD image resource, which is a 'handle' and does not contains any content of the image. Trying to display, return, or otherwise manipulate it will result in it being treated as null. I'd recommend having another php (e.g. captcha.php) that returns the image (content) and nothing else. Then you can use that php file as image (<img src='captcha.php'/>), If you insist, it is possible to embed an image by the <img src='data:image/png;base64,(content in BASE64)'/> syntax, which is supported by everything other then IE and Lynx. |
|||
By: Trent
Date: 2007-02-08
Time: 17:52
|
Re: CAPTCHA and TBSThanks sheepy. That works. Now just to get it to pass the validation data through the session so I can check the input against the image, but I'll get that worked out soon enough.
|