% 'Here is a sample of how to use the Captcha image verification ' ########################################################################### ' ###### ' ###### Example 2 Form file. ' ###### ' ########################################################################### Dim top_err, fname_err, lname_err, address_err, city_err, state_err, zip_err, phone_err, email_err, consumer_err, retailer_err, distributer_err, broker_err, hotel_err, resteraunt_err,corporate_err, other_err, comment_err, errmsg Dim ShowHTMLForm, Submit, Refresh, Submit_button, proceed Dim PathOfImageFolder Const captcha_DB_filename = "/include/fn.dat" Const forReading = 1 PathOfImageFolder = "/include/cimg/" 'Each error must be past by Session Variables or by the querystring for this Example I am passing them through session variables. top_err = Session("top_err") fname_err = Session("fname_err") address_err = Session("address_err") city_err = Session("city_err") state_err = Session("state_err") zip_err = Session("zip_err") phone_err = Session("phone_err") email_err = Session("email_err") consumer_err = Session("consumer_err") retailer_err = Session("retailer_err") distributer_err = Session("distributor_err") broker_err = Session("broker_err") hotel_err = Session("hotel_err") resteraunt_err = Session("restaurant_err") corporate_err = Session("corporate_err") other_err = Session("other_err") comment_err = Session("comment_err") errmsg = Session("errmsg") Session("top_err") = "" Session("fname_err") = "" Session("lname_err") = "" Session("address_err") = "" Session("city_err") = "" Session("state_err") = "" Session("zip_err") = "" Session("phone_err") = "" Session("email_err") = "" Session("consumer_err") = "" Session("retailer_err") = "" Session("distributor_err") = "" Session("broker_err") = "" Session("hotel_err") = "" Session("restaurant_err") = "" Session("corporate_err") = "" Session("other_err") = "" Session("comment_err") = "" Session("errmsg") = "" function getImageMappings() dim cmap(191) 'Create a filesystem object Dim FSO Set FSO = server.createObject("Scripting.FileSystemObject") Dim Filepath Filepath = Server.MapPath(captcha_DB_filename) if FSO.FileExists(Filepath) then Dim file set file = FSO.GetFile(Filepath) Dim TextStream Set TextStream = file.OpenAsTextStream(forReading, -2) i = 1 do while not TextStream.AtEndOfStream Dim Line Line = TextStream.readline Line = Split(Line, ",") 'response.write Line cmap(i) = Line(1) i = i + 1 loop Session("Captcha_Mapping") = cmap end if Set FSO = nothing end function function generateImage() upperlimit = 191 lowerlimit = 1 Randomize imageRandNum = Int((upperlimit - lowerlimit + 1)*Rnd() + lowerlimit) filenum= CStr(imageRandNum) Session("captcha_num") = imageRandNum Session("captcha_image") = PathOfImageFolder & filenum & ".jpg" 'Change the path if necessary. getImageMappings() end function generateImage() %>