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

Posted on 2009-04-29
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 ( - based on the CAPTCHA engine - ) 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
    LVL 21

    Accepted Solution

     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

    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

    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

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now