Adding CAPTCHA (or similar) to ISAPI dll in Delphi 2007

Posted on 2009-04-29
Medium Priority
Last Modified: 2013-11-23
I am tasked with creating a public website with a security check (image validation) on the very first page to restrict spam bots access. I am using Delphi 2007 with IW9.0.30 to create a ISAPI dll (as I like iSAPI better than CGIs but am open right now). I have everything done except the validation part because this is the first time I am working with JavaScript inside ISAPI. I found JCap (http://www.archreality.com/jcap/ - based on the CAPTCHA engine - http://www.captcha.net/) ) to be easier to follow and would like to use it instead of CAPTCHA itself. Has anyone done something similar to this/used Captcha/reCaptcha with ISAPI before? If not, would you happen to know of some resources/documentation/samples that can help me out?  Would it be easier to code for the check as a CGI than ISAPI?

We need this done fast and would appreciate any info that can help me out.

Thanks a lot.
Question by:vrijesh
  • 2
LVL 21

Accepted Solution

developmentguru earned 2000 total points
ID: 24261876
 I am making some assumptions here... What you need to do is generate an image that you can display on your page to have the user enter the text shown in the... somewhat distorted image.

  You can have any software generate that image (your choice, you could even do it yourself).  The generated image should be stored in a directory that is accessible to your page.  In the OnLoad of your page I would call the software to generate the image.  This should not only generate the image, but also let you know what the correct text match is.  Given the dynamic nature of the web page you should be able to dynamically generate the IMG html to point to your image.  The only part left then would be to authenticate on the button click.  You can use a Button and put code behind it to do the validation.  If it is correct you can do a response.redirect to move onto the next page, or a repsonse.redirect to make it reload the page with a new image.


1) generate image and matching text in OnLoad
2) dynamically generate IMG html to point to generated image location
3) validate

Let me know if you need more.

Author Comment

ID: 24263073
Thank you developmentguru. Yes this is what I need to do. While I was thinking about it in terms of "plugging" something in, the way you laid it out so clearly gives me some new ideas to try. I do have a set of 50 or so images already created which I could use like you mentioned. Only thing remaining is to dyamically pull up the image and validate it on the button click.

Thanks once again. Will post what I come up with soon.

Author Closing Comment

ID: 31575975
Thank you developmentguru. A look from the outside was just what I needed. When I was done, there was really nothing much to it. And the folks love having something built in-house. Thanks once again.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question